It’s happening to me too. The link works fine today and then a few hours later when you download the link, it is then a .txt file instead of a .jpg.
I checked the code you supplied and the original code is not in the .php file and I updated the permalinks, and that doesn’t help either.
This is a business site and we need it to be working properly so our customers may download the high resolution files. Can you please help? The site is http://jamiesterndesign.com