Fixed some javascript warnings.
Refactored main image page layout into a partial.