Added support for GALLERY_FOLDERS (replacing GALLERY_PATH in a similar m...

As described in #1511, this PR adds a new option GALLERY_FOLDERS (replacing GALLERY_PATH) which allows to specify input and output folder for galleries independently. It also adds support to have more than one gallery folder.
```pytb
NameError: global name 'exit' is not defined
```

use `sys.exit(1)`