It is not an easy task. If you have a backup then you could restore that. All the DB does here is provide pointers to the files. If they are missing from the correct folders then they will obviously not display so a backup of the original folder is the best option. If not then you can re-generate all the thumbs and intermediate files as per before. For the missing file you can use the file replacer plugin and restore the missing images.
When you moved your gallery did you remember to run update.php? If not run that now before proceeding with any of the above.