To get the gif functions, you will need to download GD 1.3 and compile that into php. You can find version 1.3 here:
ftp://ftp.debian.org/debian/dists/potato/main/source/libs/libgd-gif_1.3.orig.tar.gz
You will gain .GIF support, but loose .PNG support.. hope that helps!
Chris King