Fixed the generation of thumbnails