Make it Pillow compatible

I don't know the reason, but I have to import from PIL or I get a `IOError: cannot identify image file`. I found several reports about this problem in StackOverflow (e.g. http://stackoverflow.com/questions/17626042/trouble-when-open-image-with-pillow-in-python).