Added image content type white list with python-magic

This adds extra hardening against user file uploads with optional python-magic dependency.

More of this security issue is explained here:

http://stackoverflow.com/questions/17607980/limiting-what-formats-pil-image-loads

An example project here:

https://github.com/miohtama/moot.it-single-signon-example

(Whitespace where sanitized according to PEP-8, sorry about that!)