something much easier to use, is NetPBM, you just unzip the files, upload them to your server somewhere, and chmod to 755 (the folder and the files)... it's easy to use, works great
checkhttp://gallery.menalto.com/modules.php?op=modload&name=Downloads&file=index&req=viewsdownload&sid=9 << for all your Gallery-related needs
btw, they have imagemagick there, if you'd still like to install it, but again, it's simpler to just use netpbm (although installing ImageMagick on a webserver then makes it available to the whole server, which is useful if you have multiple sites running Gallery)