 			t.progressive() if opts.progressive
 			t.compressionLevel(opts.compression)
 
-			return f.pipe(t).pipe(res)
+			setHeaders res, resHeaders
+			f.pipe(t).pipe(res)
+			return

		h = parseInt(h, 10) if h
		path = decodeURI("#{opts.root}#{req.path[opts.prefix.length ..]}")
		type = mime.lookup(path)

		return next() unless type in opts.contentTypes

		req.route =
			path: "#{opts.prefix}/:slicica"
			methods: get: true

		opts.fs.stat path, (err, stats) ->
			return next() if err

			res.setHeader('Content-Type', type)
			res.setHeader('Cache-Control', "public, max-age=#{opts.maxAge}") unless opts.maxAge is false
			res.setHeader('Last-Modified', stats.mtime.toUTCString()) if opts.lastModified
			res.setHeader('ETag', etag(stats)) if opts.etag

			if fresh req, res
				res.statusCode = 304
				res.end()

			f = opts.fs.createReadStream(path).on 'error', ->
				res.statusCode = 500
				res.end()

			return f.pipe(res) unless type in imageTypes

			t = sharp().on 'error', ->
				res.statusCode = 500

	sharp.concurrency opts.concurrency

	(req, res, next) ->
		method = req.method.toUpperCase()
		return next() unless req.method.toUpperCase() in ['GET', 'HEAD']
		return next() unless req.path[0 .. opts.prefix.length - 1] is opts.prefix

		{w, h, g} = req.query
