Moved saveImage function into separate component.