Updated the gallery_tile function