Path to Images for Content Type
There are a couple of things you can do. First, instead of grabbing the filename field from the {file_managed} table, you'll want to grab the uri.

Then you can use file_create_url() to generate a url to the original file:

$icon = file_create_url($row['uri']);
$output .= '&lt;img src="' . $icon . '" /&gt;';


Or if you want to run the image through an image style, you can use image_style_url() (you'll need to know the machine name of the image style)

$icon = image_style_url('image_style', $row['uri']);
$output .= '&lt;img src="' . $icon . '" /&gt;';