Fix gallery box to fully wrap the thumbnails