Add edit gallery functionality