built grid -> gallery functionality