Various minor screenshot-script fixes

This changes the excellent script originally by @hutzelknecht in variuos minor ways:

* no more dangling whitespace,
* additional checks
* more logging
* correct detection of the examples-folder path
* other minor code formatting

Please review.