Viewport margins

Fixes #451 

@aeschylus please give it a try. One issue I'm aware of: 

1. Put in a top margin.
1. Make the window a good deal wider than the image.
1. Go home.
1. Zoom in.

Note that it zooms down; it seems that the constraints are triggering incorrectly in that case.