Updating an image src in my app

I’m calling an image at the start of my app using 

backCardImage = display.newImage(createCardGroup, "cardImage.jpg", system.TemporaryDirectory)

Later on in the app the user can change this image to one they pick from their gallery. Looking at the sandbox everything works fine and the new image ooverwrites the old one. I then call removeSelf() and set the backCardImage to nil. I then use the same code above to recreate the image which in theory should pull the new image since it was updated. However it creates the image but uses the old image even though it was overwritten. 

If I reload the app then it will pull in the new image but not until I reset the simulator. Does anyone have any ideas on how to resolve this issue?

Okay I found a strange issue…

If I put a delay between the image being removed and the new one being created it works just fine. However if I put both in a delay then it doesn’t work. I need to remove the image wait 50ms and then create the image for some reason. Anyone have an idea on why this would be? I’ve never had any issues removing and image and then recreating it on the next line.

Okay I found a strange issue…

If I put a delay between the image being removed and the new one being created it works just fine. However if I put both in a delay then it doesn’t work. I need to remove the image wait 50ms and then create the image for some reason. Anyone have an idea on why this would be? I’ve never had any issues removing and image and then recreating it on the next line.