refactors the gallery index callback to add images to galleries when created from the product form