Improve code style in image slideshow example

Fixes #623