ah... forse ho capito... vabbè... fai così:

PRIMA di ImageJPEG($thumbnail,"",80);

metti ImageJPEG($thumbnail,'nomedelfile.jpg',80);