You need to have an image control module in your PHP Modules library first. I don't have the short answer on how to do this. (don't think there is a short answer) If you manage your own server then you would have to install the modules for the image support you want. If you use a hosting company, chances are the modules are already installed. There are 3 main modules, that I know about for this.
I use a gallery management script that makes thumbs that I did not write. I use Imagemagick for the image processor. It was just easier to get working with my system than netpbm and did not require a license purchase. GD Library is limited it does not support JPG, PNG formats without being specially compiled on the server for it. Your best bet if you really want, or need this to work is visit the site links and read the specifications for setting it up.