change line
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
to
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, b.cat_name
add after
$cat_id = $row['cat_id'];
this
$cat_name = $row['cat_name'];
now you can use $cat_name in echo..