dynamic building of the thumbnails