Issue #1466252 by markoshust,rhouse: Bulletproof code when user provides incomplete img or dir specifications.