diff --git a/media.inc b/media.inc
index 53c10ec..01c564e 100644
--- a/media.inc
+++ b/media.inc
@@ -66,9 +66,9 @@ class MigrateDestinationMedia extends MigrateDestinationFile {
             'wysiwyg' => 1,
           ),
         );
-        // Get the height and width parameters if present
-        preg_match('|width=[\'"]([^\'"]+)[\'"]|i', $matches[0], $width);
-        preg_match('|height=[\'"]([^\'"]+)[\'"]|i', $matches[0], $height);
+        // Get the height and width parameters if present, also consider the inline css
+        preg_match('|width[\:\=][\'",\s]([^\'"(px)]+)[\'",(px)\;]|i', $matches[0], $width);
+        preg_match('|height[\:\=][\'",\s]([^\'"(px)]+)[\'",(px)\;]|i', $matches[0], $height);
         // image width
         if ($width) {
           $image_info['attributes']['width'] = $width[1];
