I've seen this happen when forums switch from vbulletin to xenforo. Either the photos don't get imported, or you can't import photos from a gallery. Usually the photos are still stored in a folder with a weird numbered file structure, but there's no real way to link them to a discussion, or...