Fixed long-standing bug where image wouldn't be saved and an exception
thrown if assets dir wasn't writable.