fix pil import

Python imaging library has to be imported in two different ways
depending on how it was installed. Thanks to Maxwell Grady for
suggesting this fix.