made save image return the image id

required me to make save image synchronous