Well, there should be a section in the output of phpinfo() that has a header like "gd" ... if not, then you have no graphics support anyway. Within the "gd" section, look for "gif read support" and "gif create support" and see if they're enabled.
Now then, on second glance, even if you do have gd support, I'm not sure you'd get it working with [man]echo[/man]. Look at the image functions --- specifically, I'd think you'd want [man]imagegif[/man] where you currently have the echo. A short example:
//source image
$file="images/foo.gif";
$sourceimg=imagecreatefromgif($file);
// prepare a canvas
$new_img=imagecreatetruecolor($new_width, $new_height);
// let's say we're making a thumbnail....
imagecopyresampled($new_img, $sourceimg, 0,0,0,0, $new_width, $new_height, $width, $height);
// Output the photo
header("Content-type: image/gif");
Imagegif($new_img);
Something like that ...