Make tests compatible with Pillow.

Pillow returns Unicode strings instead of str objects, so the tests
fail since there's an extra u prefix in the repr.
Merge pull request #1267 from QuLogic/pillow-compat

Make tests compatible with Pillow.