Notebook examples - Python 2 and 3 compatible

Make the example notebooks Python 2 and 3 compatible, so that Python 3 users can get started easily too.

Along the way, I found a couple of other minor issues in the notebooks, and a problem with `Image()` objects when created with `data=b'...'`.

Closes #2622.