Besides pictures, there are several folders on the SD card. I backed up the whole thing to a folder on my Windows desktop. And also used Google to backup the phone. I have an app that backs up SMS messages and call history.
I do not know what was wrong, but I reset the phone to factory settings and then the attach of pictures in Messages app worked correctly. After that, I restored from Google, from my Windows backup, and then restored SMS messages. It seems to be back to normal.
This is actually the girlfriend's phone, so I have to wait for feedback about anything that I might have overlooked.