diff --git a/resp_img.module b/resp_img.module
index d8e5372..e3b12f7 100644
--- a/resp_img.module
+++ b/resp_img.module
@@ -215,6 +215,13 @@ function resp_img_theme_registry_alter(&$theme_registry) {
         $theme_registry[$key]['preprocess functions'] = array('resp_img_pp_image');
       }
     }
+    if ($key == 'image_style') {
+      if (isset($theme_registry[$key]['preprocess functions']) && is_array($theme_registry[$key]['preprocess functions'])) {
+        array_unshift($theme_registry[$key]['preprocess functions'], 'resp_img_pp_image_style');
+      } else {
+        $theme_registry[$key]['preprocess functions'] = array('resp_img_pp_image_style');
+      }
+    }
     if ($key == 'field_slideshow') {
       if (isset($theme_registry[$key]['preprocess functions']) && is_array($theme_registry[$key]['preprocess functions'])) {
         array_unshift($theme_registry[$key]['preprocess functions'], 'resp_img_pp_field_slideshow');
@@ -248,14 +255,15 @@ function resp_img_pp_field_slideshow(&$variables) {
  */
 function resp_img_pp_image(&$variables) {
   resp_img_add_js();
+}
+
+/**
+ * Support for image styles.
+ */
+function resp_img_pp_image_style(&$variables) {
+  resp_img_add_js();
   if (isset($variables['style_name']) && $variables['style_name'] != resp_img_replace_suffix($variables['style_name'])) {
     $variables['style_name'] = resp_img_replace_suffix($variables['style_name']);
-    $variables['path'] = resp_img_replace_suffix($variables['path']);
-    foreach (array('width', 'height') as $key) {
-      if (isset($variables[$key])) {
-        unset($variables[$key]);
-      }
-    }
   }
 }
 
