So you're able to include the use package directive, but are you putting the methods you're using in the working script inside this terminal script?
I'm guessing you are using an ImageMagick method in your working script for which the proper libraries are not installed. ImageMagick has tons of libraries and can have the "appearance" of a proper install, but will be missing some features if they are not all installed.
To debug, take each specific function and isolate it in your command line script, hard-code known variables in so you can isolate the problem. Example:
## if called from a browser, uncomment
#print "content-type: text/html\n\n";
$pic = Image::Magick->new;
$x = $pic->Read("$original_image");
print "original is $type <br>\n";
print "H: $height W: $width <br>\n";
$newheight=int(($new_width * $height) / $width);
$newwidth=$new_width; ## redundant, but when you add to a sub it will make sense
print "new width: $newwidth New height: $newheight <br>\n";
print "Done, $thumbnail was created <br>\n";
As the script executes, if it dies anywhere, you are one step closer to a solution.