diff --git a/imagefield_crop.js b/imagefield_crop.js
index fae3f54..58a5712 100644
--- a/imagefield_crop.js
+++ b/imagefield_crop.js
@@ -23,7 +23,7 @@ Drupal.behaviors.imagefield_crop = {
         var self_id = self.attr('id');
         var id = self_id.substring(0, self_id.indexOf('-cropbox'));
         // get the name attribute for imagefield name
-        var widget = self.parent().parent();
+        var widget = self.parent().parent().parent();
 
           if ($(".edit-image-crop-changed", widget).val() == 1) {
               $('.preview-existing', widget).css({display: 'none'});
diff --git a/imagefield_crop.module b/imagefield_crop.module
index c5f77fa..9a98545 100644
--- a/imagefield_crop.module
+++ b/imagefield_crop.module
@@ -54,14 +54,14 @@ function imagefield_crop_field_widget_settings_form($field, $instance) {
     '#title' => t('The resolution to crop the image onto'),
     '#element_validate' => array('_image_field_resolution_validate', '_imagefield_crop_widget_resolution_validate'),
     '#theme_wrappers' => array('form_element'),
-    '#description' => t('The output resolution of the cropped image, expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 not to rescale after cropping. Note: output resolution must be defined in order to present a dynamic preview.'),
+    '#description' => t('The output resolution of the cropped image, expressed as WIDTHxHEIGHT (e.g. 640x480). Leave blank to skip rescale after cropping. Note: output resolution must be defined in order to present a dynamic preview.'),
   );
   $form['resolution']['x'] = array(
     '#type' => 'textfield',
     '#default_value' => $resolution[0],
     '#size' => 5,
     '#maxlength' => 5,
-    '#field_suffix' =>' x ',
+    '#field_suffix' => ' x ',
     '#theme_wrappers' => array(),
   );
   $form['resolution']['y'] = array(
@@ -117,7 +117,7 @@ function imagefield_crop_field_widget_settings_form($field, $instance) {
 
 function _imagefield_crop_widget_resolution_validate($element, &$form_state) {
   //dpm(__FUNCTION__);
-	$settings = $form_state['values']['instance']['widget']['settings'];
+  $settings = $form_state['values']['instance']['widget']['settings'];
   // _image_field_resolution_validate() does most of the validation
   if ($settings['enforce_ratio'] && (empty($element['x']['#value']))) {
     form_error($element, t('Target resolution must be defined as WIDTHxHEIGHT if resolution is to be enforced'));
@@ -126,18 +126,23 @@ function _imagefield_crop_widget_resolution_validate($element, &$form_state) {
 
 function _imagefield_crop_widget_enforce_ratio_validate($element, &$form_state) {
   //dpm(__FUNCTION__);
-	$settings = $form_state['values']['instance']['widget']['settings'];
-  if ($settings['resolution']['x'] && !$element['#value']) {
+  $settings = $form_state['values']['instance']['widget']['settings'];
+  if (!empty($settings['resolution']) && !$element['#value']) {
     drupal_set_message(t('Output resolution is defined, but not enforced. Final images might be distroted'));
   }
 }
 
 function _imagefield_crop_widget_enforce_minimum_validate($element, &$form_state) {
   $settings = $form_state['values']['instance']['widget']['settings'];
-  $rw = ($settings['resolution']['x']) ? $settings['resolution']['x'] : 0;
-  $rh = ($settings['resolution']['y']) ? $settings['resolution']['y'] : 0;
+  if (is_array($settings['resolution'])) {
+    $rw = ($settings['resolution']['x']) ? $settings['resolution']['x'] : 0;
+    $rh = ($settings['resolution']['y']) ? $settings['resolution']['y'] : 0;
+  }
+  else {
+    list($rw, $rh) = !empty($settings['resolution']) ? explode('x', $settings['resolution']) : array(0, 0);
+  }
 
-  if ($settings['enforce_minimum'] && 
+  if ($settings['enforce_minimum'] &&
       (!is_numeric($rw) || intval($rw) != $rw || $rw <= 0 ||
        !is_numeric($rh) || intval($rh) != $rh || $rh <= 0)) {
     form_error($element, t('Target resolution must be defined as WIDTH_HEIGHT if minimum is to be enforced.'));
@@ -148,7 +153,7 @@ function _imagefield_crop_widget_enforce_minimum_validate($element, &$form_state
 function _imagefield_crop_widget_croparea_validate($element, &$form_state) {
   //dpm(__FUNCTION__);
   foreach (array('x', 'y') as $dimension) {
-		$value = $element[$dimension]['#value'];
+    $value = $element[$dimension]['#value'];
     if (!empty($value) && !is_numeric($value)) {
       form_error($element[$dimension], t('The @dimension value must be numeric.', array('@dimesion' => $dimension)));
       return;
@@ -200,36 +205,41 @@ function imagefield_crop_widget_process($element, &$form_state, $form) {
   if ($element['#file']) {
     $file_to_crop = _imagefield_crop_file_to_crop($element['#file']->fid);
 
-    $element['preview'] = array(
-      '#type' => 'markup',
-      '#file' => $file_to_crop, // This is used by the #process function
-      '#process' => array('imagefield_crop_widget_preview_process'),
-      '#theme' => 'imagefield_crop_preview',
-      '#markup' => theme('image', array(
-                           'path' => $element['#file']->uri,
-                           'getsize' => FALSE,
-                           'attributes' => array('class' => 'preview-existing'))),
-    );
+    if (!empty($widget_settings['resolution'])) {
+      $element['preview'] = array(
+        '#type' => 'markup',
+        '#file' => $file_to_crop, // This is used by the #process function
+        '#process' => array('imagefield_crop_widget_preview_process'),
+        '#theme' => 'imagefield_crop_preview',
+        '#markup' => theme('image', array(
+                                         'path' => $element['#file']->uri,
+                                         'getsize' => FALSE,
+                                         'attributes' => array('class' => 'preview-existing'))),
+      );
+    }
+    else {
+      unset($element['preview']);
+    }
     $element['cropbox'] = array(
       '#markup' => theme('image', array(
-          'path' => $file_to_crop->uri,
-          'attributes' => array(
-            'class' => 'cropbox',
-            'id' => $element['#id'] . '-cropbox'))),
+                                       'path' => $file_to_crop->uri,
+                                       'attributes' => array(
+                                         'class' => 'cropbox',
+                                         'id' => $element['#id'] . '-cropbox'))),
     );
     $element['cropinfo'] = _imagefield_add_cropinfo_fields($element['#file']->fid);
-    list($res_w, $res_h) = explode('x', $widget_settings['resolution']);
+    list($res_w, $res_h) = !empty($widget_settings['resolution']) ? explode('x', $widget_settings['resolution']) : array(0, 0);
     list($crop_w, $crop_h) = explode('x', $widget_settings['croparea']);
     $settings = array(
       $element['#id'] => array(
         'box' => array(
-          'ratio' => $res_h ? $widget_settings['enforce_ratio'] * $res_w/$res_h : 0,
+          'ratio' => $res_h ? $widget_settings['enforce_ratio'] * $res_w / $res_h : 0,
           'box_width' => $crop_w,
           'box_height' => $crop_h,
         ),
         'minimum' => array(
-          'width'   => $widget_settings['enforce_minimum'] ? $res_w : NULL,
-          'height'  => $widget_settings['enforce_minimum'] ? $res_h : NULL,
+          'width' => $widget_settings['enforce_minimum'] ? $res_w : NULL,
+          'height' => $widget_settings['enforce_minimum'] ? $res_h : NULL,
         ),
         //'preview' => $preview_js,
       ),
@@ -238,35 +248,35 @@ function imagefield_crop_widget_process($element, &$form_state, $form) {
       'data' => array('imagefield_crop' => $settings),
       'type' => 'setting',
       'scope' => 'header',
-      );
+    );
   }
-  
+
   // prepend submit handler to remove button
   array_unshift($element['remove_button']['#submit'], 'imagefield_crop_widget_delete');
-  
+
   return $element;
 }
 
 function _imagefield_add_cropinfo_fields($fid = NULL) {
   $defaults = array(
-    'x'       => 0,
-    'y'       => 0,
-    'width'   => 50,
-    'height'  => 50,
+    'x' => 0,
+    'y' => 0,
+    'width' => 50,
+    'height' => 50,
     'changed' => 0,
   );
-  if($fid) {
-  	$crop_info = variable_get('imagefield_crop_info', array());
-  	if(isset($crop_info[$fid]) && !empty($crop_info[$fid])) {
-  		$defaults = array_merge($defaults,$crop_info[$fid]);
-  	}
+  if ($fid) {
+    $crop_info = variable_get('imagefield_crop_info', array());
+    if (isset($crop_info[$fid]) && !empty($crop_info[$fid])) {
+      $defaults = array_merge($defaults, $crop_info[$fid]);
+    }
   }
 
   foreach ($defaults as $name => $default) {
     $element[$name] = array(
       '#type' => 'hidden',
       '#title' => $name,
-      '#attributes' => array('class' => array('edit-image-crop-'. $name)),
+      '#attributes' => array('class' => array('edit-image-crop-' . $name)),
       '#default_value' => $default,
     );
   }
@@ -284,9 +294,7 @@ function imagefield_crop_widget_preview_process($element, &$form_state, $form) {
   $parents = array_slice($element['#array_parents'], 0, -1);
   $parent = drupal_array_get_nested_value($form, $parents);
   $instance = field_widget_instance($parent, $form_state);
-  if ($instance['widget']['settings']['resolution']) {
-    list($width, $height) = explode('x', $instance['widget']['settings']['resolution']);
-  }
+  list($width, $height) = !empty($instance['widget']['settings']['resolution']) ? explode('x', $instance['widget']['settings']['resolution']) : array(0, 0);
 
   $image_info = image_get_info(drupal_realpath($file->uri));
   $settings = array(
@@ -305,12 +313,12 @@ function imagefield_crop_widget_preview_process($element, &$form_state, $form) {
     'type' => 'setting',
     'scope' => 'header',
   );
-  $element['#imagefield_crop'] = array (
+  $element['#imagefield_crop'] = array(
     '#file' => $element['#file'],
     '#width' => $width,
     '#height' => $height,
     '#path' => file_create_url($file->uri),
-    );
+  );
   return $element;
 }
 
@@ -326,6 +334,7 @@ function imagefield_crop_widget_value(&$element, &$input, $form_state) {
     // get crop and scale info
     $crop = $input['cropinfo'];
     $instance = field_widget_instance($element, $form_state);
+    $scale = NULL;
     if ($instance['widget']['settings']['resolution']) {
       list($scale['width'], $scale['height']) = explode('x', $instance['widget']['settings']['resolution']);
     }
@@ -347,29 +356,29 @@ function imagefield_crop_widget_value(&$element, &$input, $form_state) {
     // // Save crop data to the database
     // $src->imagefield_crop = array('crop' => $crop);
     // file_save($src);
-    
-    if(_imagefield_crop_resize(drupal_realpath($file_to_crop->uri), $crop, $scale, drupal_realpath($src->uri))) {
-		  // insert crop info for this image in imagefield_crop_info variable
-		  $crop_info = variable_get('imagefield_crop_info', array());
-		  unset($crop['changed']);
-		  $crop_info[$src->fid] = $crop;
-		  variable_set('imagefield_crop_info', $crop_info);
-		}
-    
+
+    if (_imagefield_crop_resize(drupal_realpath($file_to_crop->uri), $crop, $scale, drupal_realpath($src->uri))) {
+      // insert crop info for this image in imagefield_crop_info variable
+      $crop_info = variable_get('imagefield_crop_info', array());
+      unset($crop['changed']);
+      $crop_info[$src->fid] = $crop;
+      variable_set('imagefield_crop_info', $crop_info);
+    }
+
   }
 }
 
 function imagefield_crop_widget_delete($form, &$form_state) {
-	$parents = array_slice($form_state['triggering_element']['#array_parents'], 0, -1);
+  $parents = array_slice($form_state['triggering_element']['#array_parents'], 0, -1);
   $element = drupal_array_get_nested_value($form_state['values'], $parents);
-	$orig = _imagefield_crop_file_to_crop($element['fid']);
-	if($orig->fid != $element['fid']) {
-		file_usage_delete($orig, 'imagefield_crop');
-		file_delete($orig);
-	  $crop_info = variable_get('imagefield_crop_info', array());
-	  unset($crop_info[$element['fid']]);
-	  variable_set('imagefield_crop_info', $crop_info);
-	}
+  $orig = _imagefield_crop_file_to_crop($element['fid']);
+  if ($orig->fid != $element['fid']) {
+    file_usage_delete($orig, 'imagefield_crop');
+    file_delete($orig);
+    $crop_info = variable_get('imagefield_crop_info', array());
+    unset($crop_info[$element['fid']]);
+    variable_set('imagefield_crop_info', $crop_info);
+  }
 }
 
 /*********************/
@@ -414,7 +423,7 @@ function theme_imagefield_crop_widget($variables) {
 function theme_imagefield_crop_preview($variables) {
   //dpm(__FUNCTION__);
   $info = $variables['element']['#imagefield_crop'];
-  $output = '<div class="jcrop-preview-wrapper" style="width:'. $info['#width'] .'px;height:'. $info['#height'] .'px;overflow:hidden;">';
+  $output = '<div class="jcrop-preview-wrapper" style="width:' . $info['#width'] . 'px;height:' . $info['#height'] . 'px;overflow:hidden;">';
   $output .= $variables['element']['#markup'];
   $output .= theme('image', array('path' => $info['#path'], 'alt' => 'jcrop-preview', 'attributes' => array('class' => 'jcrop-preview', 'style' => 'display:none')));
   $output .= '</div>';
@@ -451,13 +460,13 @@ function _imagefield_crop_resize($src, $crop = NULL, $scale = NULL, $dst = NULL)
 function _imagefield_crop_file_to_crop($fid) {
   // Try to find the original file for this image
   $result = db_select('file_usage', 'fu')
-    ->fields('fu', array('fid'))
-    ->condition('module', 'imagefield_crop')
-    ->condition('type', 'file')
-    ->condition('id', $fid)
-    ->condition('count', 0, '>')
-    ->range(0,1)
-    ->execute();
+          ->fields('fu', array('fid'))
+          ->condition('module', 'imagefield_crop')
+          ->condition('type', 'file')
+          ->condition('id', $fid)
+          ->condition('count', 0, '>')
+          ->range(0, 1)
+          ->execute();
   if ($row = $result->fetch()) {
     $fid = $row->fid;
   }
