Generate short URL's on demand

Today every request against an image generates a short URL. This should be changed so that a short URL is only generated on demand, via a query parameter or a custom request header for instance.