Reimplemented the gallery.

Now using per-page data to store the gallery details (images and
captions) in a YAML array. If present a gallery is dynamically added to
the page using the details from the YAML list.