Tiled Galleries: Use context array for templates.

Use context array for passing variables to main templates instead of littering the object instance with instance variables.