added gallery functionality