Error reported at line 64 simply tells that Perl could not open a file at previous line, this has nothing to do with GD (i.e. broken installation). You either supplied an empty string (?) or file name which doesn't exist (and then redacted it from error message so as not to distract us, which you should not have done), or undefined value (uninitialised variable) happened as argument to GD::Image::new. In latter case, running your script with "-w" switch will produce some more warnings, unfortunately suppressed otherwise (GD::Image doesn't use warnings;. As I see, dying at line 64 was quite recent addition, too.)
Edit: note, "-w" enables warnings globally, and can potentially flood you with information not exactly related to narrow problem you are trying to solve.