Removed usage of a deprecated method in Pillow.
Merge pull request #371 from timgraham/tobytes

Removed usage of a deprecated method in Pillow.