Added in a save-image function.