If you delete the main picture and the thumb, of course nothing could be generated.
Somewhere the main picture has to be stored. Just delete the thumbs, it should work.
I don't think that you understand, the image gallery created 3 files file<number>.jpg , main<number>.jpg and thumb<number>.jpg.
But I have tryed all the combinations possible, and I am now started to read the php code and as far as I can see it only creates the files with first saving the record. after that there is no check anymore.