made readySortableGalleryField into a function