Refactored gallery into thumbnails