Was geht denn genau nicht? Kommt gar kein Bild? Gibt es eine Fehlermeldung, wenn Du error_reporting(E_ALL); am Anfang Deines Skripts notierst?
Also es wird das anfangsbild nocheinmal als test3.jpg gespeichert aber ohne schrift.
Mit error_repording(E_ALL);
kommt das hier.
Notice: Use of undefined constant avatar - assumed 'avatar' in /***/test.php on line 7
Notice: Use of undefined constant jpg - assumed 'jpg' in /***/test.php on line 7
Notice: Undefined variable: StringHeight in /***/test.php on line 33