diff -upNr nodeimageblock/nodeimageblock.info nodeimageblock.new/nodeimageblock.info
--- nodeimageblock/nodeimageblock.info	1970-01-01 01:00:00.000000000 +0100
+++ nodeimageblock.new/nodeimageblock.info	2007-08-09 23:19:10.000000000 +0200
@@ -0,0 +1,4 @@
+; $Id$
+name = Node Image Block
+description = Provides a block to displays all images attached to a node.
+dependencies = upload
diff -upNr nodeimageblock/nodeimageblock.module nodeimageblock.new/nodeimageblock.module
--- nodeimageblock/nodeimageblock.module	2006-03-06 19:19:34.000000000 +0100
+++ nodeimageblock.new/nodeimageblock.module	2007-08-09 23:20:36.000000000 +0200
@@ -7,90 +7,95 @@
 
 
 /**
- * Implementation of hook_help().
- */
-function nodeimageblock_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Provides a block to displays all images attached to a node.');
-  }
-}
-
-/**
  * Implementation of hook_block().
  *
  * Displays all images that are attached to the current node
  */
-function nodeimageblock_block($op = 'list', $delta = 0) {
+function nodeimageblock_block($op = 'list', $delta = 0, $edit = array()) {
   if ($op == 'list') {
-	  $block[0]['info'] = 'Node Image';
+    $block[0]['info'] = 'Node Image';
+  }
+  elseif ($op == 'configure' &&  module_exists('imagecache')) {
+    $options = _imagecache_get_presets();
+    $options[0] = t('<none>');
+    ksort($options);
+    $form[nodeimageblock_imagecahce_preset] = array(
+      '#type' => 'select',
+      '#title' => 'Imagecache preset',
+      '#description' => 'Choose the Imagecache preset to use for the images in the Node Image Block.',
+      '#options' => $options,
+      '#default_value' => variable_get('nodeimageblock_imagecahce_preset', 0),
+    );
+    return $form;
   }
-  elseif($op = 'view') {
-	  if($nid = _nodeimageblock_getnid()) {
-  		if ($node = node_load(array('nid' => $nid))) {
-
-  		  // Get all images associated with this node
-  			$imagesrc = _nodeimageblock_get_node_images($node);
-
-  			if(count($imagesrc) > 0) {
-  			  $output = '';
-    			foreach($imagesrc as $img) {
-      			$output .= theme('nodeimageblock_block_item', $node, $img);
+  elseif ($op == 'save') {
+    variable_set('nodeimageblock_imagecahce_preset', $edit['nodeimageblock_imagecahce_preset']);
+  }
+  elseif ($op == 'view') {
+    if (arg(0) == 'node') {
+      $nid = arg(1);
+      if ($node = node_load(array('nid' => $nid))) {
+
+        // Get all images associated with this node
+        $images = _nodeimageblock_get_node_images($node);
+
+        if (count($images) > 0) {
+          $output = '';
+          if (($imagecache_preset = variable_get('nodeimageblock_imagecahce_preset', 0)) && module_exists('imagecache')) {
+            $imagecache_preset = _imagecache_preset_load($imagecache_preset);
+            foreach($images as $img) {
+              $html = theme('imagecache', $imagecache_preset, $img->filepath, $img->description, $img->description);
+              $output .= theme('nodeimageblock_block_item', $html, $img);
+            }
+          }
+          else {
+            foreach($images as $img) {
+              $html = theme('image', $img->filepath, $img->description, $img->description);
+              $output .= theme('nodeimageblock_block_item', $html, $img);
+            }
           }
 
-    			$block['subject'] = '';
-    			$block['content'] = theme('nodeimageblock_block', $output);
-  			}
-  		}
-	  }
+          $block['subject'] = '';
+          $block['content'] = theme('nodeimageblock_block', $output);
+        }
+      }
+    }
   }
 
   return $block;
 }
 
-function _nodeimageblock_getnid(){
-    $path = drupal_lookup_path('source', $_GET['q']);
-    if($path == false){
-        $path = $_GET['q'];
-    }
-    $pathvars = explode('/', $path);
-    if ($pathvars[0] == 'node'){
-        $nid = $pathvars[1];
-    }
-    return $nid;
-}
-
 function theme_nodeimageblock_block($items) {
-	$output  = '<div id="nodeimageblock">';
-	$output .= $items;
-	$output .= '</div>';
-	return $output;
+  $output  = '<div id="nodeimageblock">';
+  $output .= $items;
+  $output .= '</div>';
+  return $output;
 }
 
-function theme_nodeimageblock_block_item($node, $imagesrc) {
-	$output = '
-	<div class="nodeimage">
-	    <img src="' . $imagesrc . '" alt="" />
-	</div>';
+function theme_nodeimageblock_block_item($html, $img) {
+  $output = '
+  <div class="nodeimage">
+    '. $html .'
+		<p>'. $img->description .'</p>
+  </div>';
 
-	return $output;
+  return $output;
 }
 
 function _nodeimageblock_get_node_images($node) {
-	$filepath = '';
 
-	// -- if upload.module is enabled
-	if($files = module_invoke('upload', 'load', $node)) {
-		$image_mime = array("image/gif", "image/png", "image/jpeg", "image/pjpeg");
-		$images = array();
-
-		foreach($files as $key => $file){
-
-			// --- Is the file an image?
-			if(in_array($file->filemime, $image_mime)) {
-				$images[] = file_create_url($file->filepath);
-			}
-		}
-	}
-	return $images;
+  // -- if upload.module is enabled
+  if ($files = module_invoke('upload', 'load', $node)) {
+    $image_mime = array("image/gif", "image/png", "image/jpeg", "image/pjpeg");
+    $images = array();
+
+    foreach ($files as $file) {
+
+      // --- Is the file an image?
+      if(in_array($file->filemime, $image_mime) && $file->list) {
+        $images[] = $file;
+      }
+    }
+  }
+  return $images;
 }
diff -upNr nodeimageblock/README.txt nodeimageblock.new/README.txt
--- nodeimageblock/README.txt	2006-02-09 16:29:13.000000000 +0100
+++ nodeimageblock.new/README.txt	2006-02-09 16:19:11.000000000 +0100
@@ -31,3 +31,10 @@ In the Blocks configuration page (?q=adm
 and assign it to a region on the page.
 
 
+
+
+Security
+========
+To restrict who can see your 'contact card' nodes I suggest using the Simple_Access module.
+Available from http://drupal.org/project/simple_access
+
