Added support for defining a gallery template.