Finalize thumbnail handling, also tweak gallery css

All page images which have a max size specified will be rendered
with the thumbnail process. If an image name includes the thumb:
pseudo scheme, it will also render as a link to the full image.
minor clean ups/fixes
Passing variable in link causes issues in menu display.
Add missing default value for options[2]
Show loading anim between page loads
Small cleanup of indentation