index 7f6d7d7..aa0fa2b 100644
--- a/jail.module
+++ b/jail.module
@@ -176,6 +176,15 @@ function theme_jail_formatter($variables) {
     'path' => $item['uri'],
     'alt' => $item['alt'],
   );
+
+  if (isset($item['width']) && isset($item['height'])) {
+    $image['width'] = $item['width'];
+    $image['height'] = $item['height'];
+  }
+  if (isset($variables['jail_image_style'])) {
+    image_style_transform_dimensions($variables['jail_image_style'], $image);
+  }
+
   $effect = $variables['jail_effect'];
   // Do not output an empty 'title' attribute.
   if (drupal_strlen($item['title']) > 0) {
@@ -187,7 +196,9 @@ function theme_jail_formatter($variables) {
   else {
     $url = image_style_url($variables['jail_image_style'], $item['uri']);
   }
-  $output = '<img class="lazy" data-href="' . $url . '" src="' . $placeholder . '"/>';
+
+  $attributes = drupal_attributes($image);
+  $output = '<img class="lazy" ' . $attributes  . ' data-href="' . $url . '" src="' . $placeholder . '"/>';
   if ($variables['path']) {
     $path = $variables['path']['path'];
     $options = $variables['path']['options'];
