The task itself is a real booger, and can be complicated by how the original (old) images were stored and organized...
My largest concern is the number of Google (and other) searches that should land on a good thread here, that instead lead would-be readers to a post that has no value without the accompanying images...
It should be quite simple to re-instate the missing images in old posts, assuming a back-up file from the old server is still available.
There were on the old server in the format:
where the /123/ sub-folder is the user's ID number.
• If the old /gallery/ folder is copied as-is to the new server, all the images in the old posts would become visible again.
The problem is that this wouldn't recreate the Photo Gallery in the new software or allow members to access and edit their old pictures in there.
But getting the old posts working again is surely the most important requirement? If necessary members can recreate their Gallery by uploading afresh.