Tiled Gallery: Use an HTML builder.

String HTML tags with a lot of attributes are painful to read and modify. Using a builder makes those tags much easier to modify and read.