Index: branches/release-41/php/lib/function.mtcommenteruserpic.php
===================================================================
--- branches/release-41/php/lib/function.mtcommenteruserpic.php (revision 1174)
+++ branches/release-41/php/lib/function.mtcommenteruserpic.php (revision 2651)
@@ -22,4 +22,7 @@
     require_once("MTUtil.php");
     $userpic_url = userpic_url($asset[0], $blog, $cmntr);
+    if (empty($userpic_url))
+        return '';
+
     $asset_path = asset_path($asset[0]['asset_file_path'], $blog);
     list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path);
Index: branches/release-41/php/lib/thumbnail_lib.php
===================================================================
--- branches/release-41/php/lib/thumbnail_lib.php (revision 2580)
+++ branches/release-41/php/lib/thumbnail_lib.php (revision 2651)
@@ -16,4 +16,9 @@
     function Thumbnail ($src) {
         $this->src_file = $src;
+    }
+
+    # Can we use function of GD?
+    function is_available () {
+        return extension_loaded('gd');
     }
 
@@ -90,4 +95,9 @@
         if (empty($this->src_file)) return false;
         if (!file_exists($this->src_file)) return false;
+        if (!$this->is_available()) {
+            global $mt;
+            $mt->warning_log($mt->translate('GD support has not been available. Please install GD support.'));
+            return false;
+        }
 
         # Get source image information
Index: branches/release-41/php/lib/function.mtauthoruserpic.php
===================================================================
--- branches/release-41/php/lib/function.mtauthoruserpic.php (revision 2356)
+++ branches/release-41/php/lib/function.mtauthoruserpic.php (revision 2651)
@@ -26,4 +26,6 @@
     require_once("MTUtil.php");
     $userpic_url = userpic_url($asset[0], $blog, $author);
+    if (empty($userpic_url))
+        return '';
     $asset_path = asset_path($asset[0]['asset_file_path'], $blog);
     list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path);
Index: branches/release-41/php/lib/function.mtassetthumbnaillink.php
===================================================================
--- branches/release-41/php/lib/function.mtassetthumbnaillink.php (revision 1174)
+++ branches/release-41/php/lib/function.mtassetthumbnaillink.php (revision 2651)
@@ -28,4 +28,8 @@
 
     list($thumb, $thumb_w, $thumb_h) = get_thumbnail_file($asset, $blog, $width, $height, $scale);
+    if (empty($thumb)) {
+        return '';
+    }
+
     $target = "";
     if (isset($args['new_window']))
Index: branches/release-41/php/lib/function.mtentryauthoruserpic.php
===================================================================
--- branches/release-41/php/lib/function.mtentryauthoruserpic.php (revision 1174)
+++ branches/release-41/php/lib/function.mtentryauthoruserpic.php (revision 2651)
@@ -23,4 +23,6 @@
     require_once("MTUtil.php");
     $userpic_url = userpic_url($asset[0], $blog, $author);
+    if (empty($userpic_url))
+        return '';
     $asset_path = asset_path($asset[0]['asset_file_path'], $blog);
     list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path);
Index: branches/release-41/php/lib/MTUtil.php
===================================================================
--- branches/release-41/php/lib/MTUtil.php (revision 2595)
+++ branches/release-41/php/lib/MTUtil.php (revision 2651)
@@ -1301,5 +1301,7 @@
     $dest;
     $thumb_name = $static_file_path.DIRECTORY_SEPARATOR.$image_path.DIRECTORY_SEPARATOR.$format;
-    $thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name, 'png');
+    if (!$thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name, 'png')) {
+        return '';
+    }
     $basename = basename($dest);
 
@@ -1345,5 +1347,7 @@
     $thumb_h = $height;
     $dest;
-    $thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name);
+    if (!$thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name)) {
+        return '';
+    }
 
     # make url
