Moved preview and exif functions to own file, media.js.
Did some improvements on error checking for the preview generation.
Added/fixed support for CR2 files in preview generation.
Removed ids and names from login form to fix it resetting username and hinder login.