Track viewport size

Changed: add middleware and Javascript library that measures and
sends viewport size to the backend code (or defaults to 300x300
when unknown).
Fix for generating original url in get_url_for_size
Middleware should always return size as integers