how to display image

Permalink
I have the following code and doesn't work to display image.
How to fix instead of this code?

$rsSelect = $dbSelect->Execute("SELECT * FROM StudentExpressSearchIndexAttributes");
foreach($rsSelect->fetchAll() as $row) {
   $imgHelper = Loader::helper('image');
   global $c;
   if ($c->getAttribute($row['Image'])) {
        $image = $imgHelper->getThumbnail($c->getAttribute('image'), 350, 350)->src;
   }
}

 
davidkham replied on at Permalink Reply
The following code worked
<?php
$ih = Loader::helper('image');
$image = File::getByID($row['Image']);
$thumbnail = $ih->getThumbnail($image, 50, 50, true);
?>
<img src="<?php echo $thumbnail->src; ?>">