The part with the images I figured out. I did it like this:
echo "<tr><td>";
if($BackupState == 'BS_STOP_SUCCESS')
{
echo '<img src="images\apply.png" width="16" height="16" alt=\"Success\">';
}
elseif($BackupState == 'BS_STOP_SUCCESS_WITH_ERROR')
{
echo '<img src="images\warning.png" width="16" height="16" alt=\"Warning\">';
}
else
{
echo '<img src="images\cancel.png" width="16" height="16" alt=\"Cancelled\">';
} ?>