correcting issue where galleries of only one image had an empty next button