You've got two options:
1) When you're renaming a file, leave the .jpg bit at the end. If you remove it, then as you've discovered, Windows will get confused.
2) If the above is likely to be too much faff then go to Control Panel -> Folder Options -> "View" tab -> tick the option that says Hide file extensions for known file types -> click "OK". When you next try to rename a file the file-extension will be always be retained and you shouldn't have the same problem.