in reply to Kill file that I created, and recreate

change your fourth line to $cmd3 = "rm -f ".$imgfile.""; to "force" the delete, a.k.a. to not prompt you for verification.