diff --git a/image_caption_filter.module b/image_caption_filter.module
index 1f4914c..3ccdb71 100755
--- a/image_caption_filter.module
+++ b/image_caption_filter.module
@@ -63,7 +63,7 @@ function doImgTitles($matches) {
   $title = $matches[1];
 
   //Get the width out of the <img> tag
-  preg_match ('/width=\"(.+?)\"/i', $imgText, $matches);
+  preg_match ('/width:(.+?)px/i', $imgText, $matches);
   $width = $matches[1];
 
   //Get class out of the <img> tag
