Significantly change gallery layout, and add code to handle keyboard navigation of images.
Improve auto-fit calculations.