Re-Theme Private Message Function
$text = l('&lt;img src="messages.png" height="40"/&gt;); looks wrong. "l" is function to create links, i guess thats what is failing here. Try to remove it and leave just $text = '&lt;img src="messages.png" height="40"/&gt;';.

For reference on "l" see drupal api page - please note that there is also 'HTML' parametr in "l" function that you should set to true, since you are passing HTLM code in $text to that returning "l".


  'html' (default FALSE): Whether $text is HTML or just plain-text. For example, to make an image tag into a link, this must be set to TRUE, or you will see the escaped HTML image tag. $text is not sanitized if 'html' is TRUE. The calling function must ensure that $text is already safe.