Add option for custom base directory.

Hello.

I found myself wanting to specify a custom base directory for images, so I added an option to do that.

It's tested and documented. I refactored the tests a little to extract some common functionality. I've also included two other caretaking commits. If you don't like them, just say the word and I'll slice 'em out.

Thanks for sharing your work on this!

Caden