Another specific comment about passing image filenames: while you can quote suboptions (like
-g's
file) just fine, one caveat of being a suboption is that it cannot contain a comma, as that's the suboption separator.
As such, when passing dynamic values, I'd recommend using the
-i flag instead (and quoting the arg). The redundancy in functionality exists purely to circumvent the comma limitation of the suboption approach

.