Added image dir source.

Also: improved comments and error messages.