Had the same problem and the solution is to add a line of code before imagecreatefrom jpeg:

[PHP]ini_set('memory _limit', '50M');
$handle = @imagecreatefro mjpeg($pict);[/PHP]

virtual@croatia