Try importing from Pillow before falling back to the original PIL

The [official version of PIL](http://www.pythonware.com/products/pil/) hasn't been updated since 2009, and [Pillow](http://python-imaging.github.io/) is easier to install on modern systems; however, the relevant classes are now in the `PIL` namespace instead of the global namespace. This pull request modifies the code to try importing the imaging classes from the `PIL` namespace; if that fails, the global namespace will be used as a fallback.