Not sure how I can fix anything for you. I fixed the issue you reported here with that 605 category that was easy. However it may dive into a deeper issue.
The only way photos would be lost in the database is if you run a scan database and your data directory path is incorrect. That way we cant find files and they are removed from the database.
Do you have site backups?
You would actually need to restore your photos table entries to restore the photos from a database backup.