--- userpoints_user_picture.module	2011-01-26 03:04:58.000000000 -0200
+++ userpoints_user_picture_bak.module	2011-02-17 14:12:55.000000000 -0200
@@ -61,6 +61,7 @@ function userpoints_user_picture_user($o
 	
 	$params = array(
 	 'uid'         => $user->uid,
+   'moderate' => TRUE,
 	 'entity_id'   => $user->uid,
 	 'entity_type' => 'user',
 	 'tid'         => variable_get(USERPOINTS_USER_PICTURE_TID, 0),
@@ -71,12 +72,21 @@ function userpoints_user_picture_user($o
 			if ((empty($user->picture)) && $file = file_save_upload('picture_upload')) {
 				 // Award the points
 				 $params['points'] = variable_get(USERPOINTS_USER_PICTURE, 0);
-				 $params['operation'] = 'User Picture Added';
+				 $params['operation'] = t('User Picture Added');
 			}
-			elseif ((!empty($user->picture)) && !empty($edit['picture_delete'])) {
+			elseif ((!empty($user->picture)) && !empty($edit['picture_delete']) && !$file = file_save_upload('picture_upload')) {
 				 // Subtract the points
 				 $params['points'] = -(variable_get(USERPOINTS_USER_PICTURE, 0));
-				 $params['operation'] = 'User Picture Deleted';
+				 $params['operation'] = t('User Picture Deleted');
+      }
+      if ((!empty($user->picture)) && $file = file_save_upload('picture_upload')) {
+				 // Subtract the points
+				 $params['points'] = -(variable_get(USERPOINTS_USER_PICTURE, 0));
+				 $params['operation'] = t('User Picture Deleted');
+         userpoints_userpointsapi($params);
+				 // Award the points
+				 $params['points'] = variable_get(USERPOINTS_USER_PICTURE, 0);
+         $params['operation'] = t('User Picture Added');
 			}
 			break;
 		
@@ -88,7 +98,7 @@ function userpoints_user_picture_user($o
 				$params['uid'] = $user->uid;
 				$params['entity_id'] = $user->uid;
 				$params['points'] = variable_get(USERPOINTS_USER_PICTURE, 0);
-				$params['operation'] = 'User Picture Added';
+				$params['operation'] = t('User Picture Added');
 			}
 			break;
 			
