Fixing PIL Image import to avoid ImportErrors.

Surrounding the PIL Image import with a try block and additional import
statement.