Support PIL or Pillow.

Clean up examples so that Pillow can be used rather than the deprecated
PIL library.