fixes #2353 Now file extensions are not replaced if they are something other than expected. So if you were saving a PNG, foobar.jpg would become foobar.jpg.png, not foobar.png. Of course, foobar.png would be foobar.png.