Recently I had problems changing my wordpress image url to my affiliate link. Everytime I tried to change the url to my affiliate link, the url will revert back to the original url.
By trial and error, I found the solution.
1. Go to your page or post with the image.
2. Edit your image
.
Then do an update on the page/post.
Go back to your edit image again and repeat the process but this time put in your affiliate link in the blank url.
Update the image and when complete update the page/post again.
Your affiliate link should be there, check and made sure the link works.