3 bugs fixed

* use gallery path from config.
* do not fail on corrupted images. needs proper handling.
* do nos assume filenames are ascii; use system's encoding.