public static function getSizedImagePath($uuid, $size)
    {
        $container = \System::getContainer();
        $rootDir = $container->getParameter('kernel.project_dir');

        if (!($path = Files::getPathFromUuid($uuid))) {
            return false;
        }

        $size = unserialize($size);

        if (is_array($size))
        {
            if (count($size) < 3)
            {
                return false;
            }
            else
            {
                $size = $size[2];
            }
        }

        return $container->get('contao.image.image_factory')->create(
            $rootDir . '/' . $path, $size
        )->getUrl($rootDir);
    }