--- nodeimageblock_orig.module	2006-03-06 10:19:34.000000000 -0800
+++ nodeimageblock.module	2007-06-05 11:28:12.000000000 -0700
@@ -26,8 +26,8 @@
 	  $block[0]['info'] = 'Node Image';
   }
   elseif($op = 'view') {
-	  if($nid = _nodeimageblock_getnid()) {
-  		if ($node = node_load(array('nid' => $nid))) {
+    if (arg(0)=='node' && is_numeric(arg(1))){
+      if ($node=node_load(arg(1))) {
 
   		  // Get all images associated with this node
   			$imagesrc = _nodeimageblock_get_node_images($node);
@@ -48,18 +48,6 @@
   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;
