Use filename variables in examples

to make it more obvious that the _img functions can take filenames as
input. Other minor fixes went in while I was at it.

Please enter the commit message for your changes. Lines starting
Merge pull request #323 from lesteve/use-filename-variables-in-examples

Use filename variables in examples