some changes to clean up gallery.