public function getThumbnail(FileStorage $entity, string $version) : string
    {
        $versions = (array)Configure::read('FileStorage.imageHashes.file_storage');
        if (empty($versions)) {
            return str_replace(DS, '/', $entity->get('path'));
        }

        if (! array_key_exists($version, $versions)) {
            return str_replace(DS, '/', $entity->get('path'));
        }

        $path = in_array(strtolower($entity->get('extension')), self::IMAGE_EXTENSIONS) ?
            $this->getImagePath($entity, $version) :
            $this->getIconPath($entity, $version);

        return str_replace(DS, '/', $path);
    }