clean up markup for gallery