Updated gallery_view Layout to hide blank elements