Updating my custom module to Drupal 7
In Drupal 7, instead of hook_block() there are more hooks:


hook_block_info()
hook_block_configure()
hook_block_save()
hook_block_view()


In short, you need to split the Drupal 6 code for hook_block() between those hooks.

As side notes:


Every function implemented from a module should be prefixed by the module short name
To load the node, you should use the following code.

if ($node = menu_get_object()) {
  // The page is a node page.
}  

To access the content of a field, you should use the following code.

$items = field_get_items('node', $node, 'field_head_img');
$path = $items[0]['filepath'];

To output an image, you should use theme('image'), or theme('image_style'). As you are outputting a field, you should use field_view_field(), as in the following code.

$output = field_view_field('node', $node, 'field_head_img');