Add template to pagination and gallery (single image)