Added New/Edit gallery functionality