Mountain Lion wouldn't change anything on your phone. If your phone is jailbroken I don't expect you to discuss it on here, but there are several problems with some third-party jailbreak software. This is what I would do to easily find out if it's software-based.
1. Plug in to iTunes and let it perform a complete backup.
2. Restore your phone to factory defaults.
3. Set it up as a new phone so you can make phone calls, but do NOT sync or restore any of your apps/data
4. Unplug the phone from your computer. Make sure you set it up with your Apple ID if it isn't already.
5. Try to send a picture with iMessage.
Let me know if it works. Remember, all of your stuff is backed up and once you restore the backup your phone will be EXACTLY how it was, even stuff like your texts. So don't worry about losing anything. It just takes a bit of time.