diff --git a/image_effect.module b/image_effect.module
index f3a6e32..69089c5 100644
--- a/image_effect.module
+++ b/image_effect.module
@@ -29,22 +29,22 @@ function image_advance_resize_effect(&$image,$data){
 }
 
 function image_advance_resize(stdClass $image, $width, $height) {
-  $w=$width;
-  $h=$height;
-  $src_x=0;
-  $src_y=0;
-  $src_w=$image->info['width'];
-  $src_h=$image->info['height'];
+  $w = $dst_w = $width;
+  $h = $dst_h = $height;
+  $src_x = $dst_x = 0;
+  $src_y = $dst_y = 0;
+  $src_w = $image->info['width'];
+  $src_h = $image->info['height'];
   $src_image = $image->resource;
-  $dst_w=$src_w;
-  $dst_h=$src_h;
-  $dst_x=0;
-  $dst_y=0;
-  if($w>$src_w)
-	  $dst_x=($w-$src_w)/2;
-  if($h>$src_h)
-	  $dst_y=($h-$src_h)/2;
-  $dst_image = imagecreatetruecolor($w,$h);
+  if ($w > $src_w) {
+    $dst_w = $src_w;
+    $dst_x = ($w - $src_w) / 2;
+  }
+  if ($h > $src_h) {
+    $dst_h = $src_h;
+    $dst_y = ($h - $src_h) / 2;
+  }
+  $dst_image = imagecreatetruecolor($w, $h);
   $backgroundColor = imagecolorallocate($dst_image, 255, 255, 255);
   imagefill($dst_image, 0, 0, $backgroundColor);
   imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
