diff --git image_caption.js image_caption.js
index 9dabc15..0f840d2 100644
--- image_caption.js
+++ image_caption.js
@@ -1,19 +1,21 @@
 /*$Id: image_caption.js,v 1.2.2.3 2010/02/03 07:50:25 davidwhthomas Exp $*/
 $(document).ready(function(){
   $("img.caption").each(function(i) {
-    var imgwidth = $(this).width();
-    var imgheight = $(this).height();
     var captiontext = $(this).attr('title');
-    var style = $(this).attr('style');
-    var alignment = $(this).attr('align');
-    //Clear image styles to prevent conflicts with parent div
-    $(this).attr({align:""});
-    $(this).attr({style:""});
-    $(this).wrap("<span class=\"image-caption-container\" style=\"display:block;" + style + "; float: " + alignment + "\"></span>");
-    $(this).parent().addClass('image-caption-container-' + alignment);
-    if(imgwidth != 'undefined' && imgwidth != 0){
-      $(this).parent().width(imgwidth);
+    if (captiontext != '') {
+      var imgwidth = $(this).width();
+      var imgheight = $(this).height();
+      var style = $(this).attr('style');
+      var alignment = $(this).attr('align');
+      //Clear image styles to prevent conflicts with parent div
+      $(this).attr({align:""});
+      $(this).attr({style:""});
+      $(this).wrap("<span class=\"image-caption-container\" style=\"display:block;" + style + "; float: " + alignment + "\"></span>");
+      $(this).parent().addClass('image-caption-container-' + alignment);
+      if(imgwidth != 'undefined' && imgwidth != 0){
+        $(this).parent().width(imgwidth);
+      }
+      $(this).parent().append("<span style=\"display:block;\" class=\"image-caption\">" + captiontext + "</span>");
     }
-    $(this).parent().append("<span style=\"display:block;\" class=\"image-caption\">" + captiontext + "</span>");
   });
 });
\ No newline at end of file
