converting thumbnails to directive