The NextGen Gallery is one of the plugins that I use on lots of WordPress sites.
I’d never struck this before and the information from all the blogs and forum posts I looked at did not or could not resolve how to fix this issue.
The situation arises when you rename an image file directly in the file manager, or in my case the linux command line. The filename is actually stored in the database in the wp_ngg_pictures table and for manual correction you would expect that updating the filename column would be sufficient.
Then selecting the image and the recreate thumbnail option is expected to do just that, but it doesn’t. You may see an “error occurred” message in the thumbnail creation screen but it is not a helpful message.
The issue is in fact that the thumbnail details are stored in another column called metadata in the same table and this column is referenced for the thumbnail update and not the filename, i.e. NGG is still the original thumbnail filename and recreating that file not the new file.
There are two steps required, change the filename in that column and delete the metadata field value back to null or empty. Then you can re-create your thumbnails and they will work with the new filename.