Tiled Gallery: Extract HTML generation logic.

HTML generation logic is separated into templates and partials.
Tiled Gallery: Move function and make static.

Moved a function that builds the extra data for containers (for carousel) to the plugin file, since it is not in the responbility of the layout to build it and doesn't belong there.
Photon: Tweak data-recalc-dims regex.

The regex adding the data-recalc-dims should not care how many whitespace characers there are between the closing tag and the possible following link tag.
Tiled Gallery: Split data-original-size getter.

Split the function that produces the string into data-orig-size (for carousel) into two. When meta width and height are separated, we avoid having presentation logic pieces in the model object.
Tiled Gallery: Pass context to partials as param.

Avoid having to litter the object instance (by putting stuff into `$this`) for partials, and allow the `template` and `partial` functions take a context array whose values will be extracted to the symbol table. Context required by partials is now passed via the context param.
Revert "Tiled Gallery: Move function and make static."

This reverts commit d8a8071b63c5f617ce70670f7ad6685ee9943e65.