Added support for multiple galleries on a page.