Add html code of thumbnails in templates