Correct. So far I follow you when trying to reproduce this.
Hm, that's where I'm losing you: the code for the thumbnails is genereted by strtolower-ing the file extension, thus it is always lowercase.
Actually, the path and filename used to show the thumbnails in the popup window and for the insertion process come from exactly the same variable - they can not be different. Their extensions both have to be lowercase.
By the way: If I'm uploading an image that has a uppercase extension, vBG changes the original uppercase extension to lowercase.
That's what the script does at the moment, actually...
No problem, really. Since I do not use vBG in a productive environment, I don't have the ability to do such intensive testing. This way, sooner or later we'll get it goin'
So, after some more thinking, I decided to take more information directly from the database. All filenames - thumbs, originals, everything including extensions - are now taken directly from the database and thus should mirror exactly what vBG uses. If it works there, it should also work with this mod. Please test the attached config file and see whether it solves the problem. If not, please check whether vBG indeed saves original files with uppercase extensions (which it does not for me - and I was unable to find an option in the vBG settings, tho I did not look too hard) and provide the content of the debug table field for "Code".