             else
               return base + '/' + (i + 1)
     list = getSketchesByRegexp(sketches, regexp).reverse()
-    res.send header + formatList(req, list, urlFunc, '33%') + footer
+    res.send header(req.app.locals.templateVars) + formatList(req, list, urlFunc, '33%') + footer(req.app.locals.templateVars)
 exports.serveImagesByDate = serveImagesByDate
 
 ################################################################################

  page = ''
  getSketches(SKETCH_DIR).then (sketches) ->
    q(getSketchesByTags(sketches, tag)).then (list) ->
      res.send header + formatList(req, list) + footer
exports.serveImagesByTag = serveImagesByTag

showSketchesByRange = (req, res) ->

  getSketches(SKETCH_DIR).then (sketches) ->
    inRange = sketches.filter (x) ->
      return x >= start && (!end || x <= end)
    res.send header(req.app.locals.templateVars) + formatList(req, inRange) + footer(req.app.locals.templateVars)
exports.showSketchesByRange = showSketchesByRange

serveImagesByDate = (req, res) ->
