add gallery functionality