Address #188 (gallery names not propagated to mtxOutput)

Previously mtxOutput assumed the gallery name was set as metadata on each template, and just read it from the first template it received, and this metadata was only set in TemplateList::fromGallery.

This branch changes mtxOutput to have the query and target gallery names as parameters, which are set directly when the output is created.