What's the "Drupal" way of creating image links? I know that the correct way to create links in Drupal is to use l($text, $path, array $options = array()). But that only allows for text links. Is there a similar function for creating images that link, or is it OK to just write out the HTML?
l() allows for HTML too, you just need to pass it as one of the options:

$link = l($image_html, $path, array('html' =&gt; TRUE));


That'll stop the first parameter being passed through check_plain(), so the the full HTML you pass in will be wrapped in the &lt;a&gt; tag. 

I'd advise using this method if the alternative is writing the link out manually, you get the benefit of automatic alias-translation and it's less prone to small errors in the HTML (of which I for one always make loads).