protected function renderIcon($model, $imagesOnly = false, $downloads = false)
    {
        if ('folder' === $model->type) {
            if ($imagesOnly || $downloads) {
                return false;
            }

            return Image::getHtml('folderC.svg') . ' ' . $model->path;
        }
        $file = new File($model->path);
        $info = $this->renderFileInfo($file);

        if ($imagesOnly && !$file->isImage) {
            return false;
        }

        if ($downloads) {
            if ($this->isAllowedDownload($file->extension)) {
                return Image::getHtml($file->icon) . ' ' . $info;
            }

            return false;
        }

        if (!$file->isImage) {
            return Image::getHtml($file->icon) . ' ' . $info;
        }

        return $this->generateGalleryImage($model, $file, $info);
    }