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