Interesting. This is working now. I added this line:
imagealphablending($overlay,false);
and I replaced:
imagecopymerge($thumb,$overlay,0,0,0,0,197,158,100);
with:
imagecopy($thumb,$overlay,0,0,0,0,197,158);
and that did the trick.
So it's all working for me now... I'm taking a...