Helper methods to save/image to/from a directory.