public function findMedias(array $types = [])
    {
        if (null === $this->folder) {
            throw new \RuntimeException('No folder selected.');
        }

        $criteria = ['folder' => $this->folder];
        if (count($types)) {
            $criteria['type'] = $types;
        }

        /** @var MediaInterface[] $medias */
        $medias = $this->repository->findBy($criteria);

        foreach ($medias as $media) {
            $media
                ->setThumb($this->thumbGenerator->generateThumbUrl($media))
                ->setFront($this->thumbGenerator->generateFrontUrl($media))
            ;
        }

        return $medias;
    }