So the issue lies with how IIS is dealing with the URL rewrite. What you currently have above will allow IIS to properly rewrite the URLs for pages inside of WordPress, but for some reason, it messes up the original, uploaded images. If you were to modify the above to use <match url=”.*”/> then the images would upload and start working properly, but the URL rewrite for the pages will now force all pages to a 404.
At this point, I have enabled the web.config to work for the pages and have been manually fixing the images. If you have direct access to the upload directory, you can go in and force ownership and read permissions on the main image after it is uploaded. This will allow you to use the image. It’s a very manual, very pain in the butt workaround, but it will at least get you up and running until someone smarter than us for IIS and wordpress can find a wildcard combination that will allow both the images and the pages to be URL rewritten properly.
I have tried writing 2 rules in my web.config to deal with both conditions, but I have been unsuccessful.
(side note: all of the thumbnails that wordpress creates will work fine without the 500 error. it only appears to be the uploaded original image that is breaking)