make sure prev/next button only apply to one gallery on the page