Programatically linking an image to content (Drupal 7)
You can use the l() function to wrap the image in a link. As it's HTML you'll need to pass the html option to the function so that it isn't run through check_plain():

$image = theme('image', $variables);

$linked_image = l($image, "node/$node-&gt;nid", array('html' =&gt; TRUE));

$rows[] = array(
  l($node-&gt;title, "node/$node-&gt;nid"),
  $linked_image,
  date($format, $node-&gt;changed)
);