private function renderList(array &$icons, Collection $collection = null, $followSubDirs = false)
    {
        if (!$collection) {
            return;
        }

        foreach ($collection->getModels() as $model) {
            // File system and database seem not in sync
            if (!\file_exists($this->rootDir . '/' . $model->path)) {
                continue;
            }

            if (('folder' === $model->type) && $followSubDirs) {
                $this->renderList($icons, FilesModel::findByPid($model->uuid));
                continue;
            }
            if (false !== ($icon = $this->renderIcon($model, $this->isGallery, $this->isDownloads))) {
                $icons[\md5($model->uuid)] = ['uuid' => $model->uuid, 'image' => $icon];
            }
        }
    }