Somehow -- I'm not sure how, and I'm not exactly sure when -- my website (powered by drupal) lost all of its images. They were still there in the filesystem, and the rows were still in the node table, but they'd vanished from the actual pages.
Further investigation revealed that the image and files tables had mostly forgotten about those images. So, how to quickly fix this all up?