implemented lazy loading for gallery