I keep getting broken images with IMAP_fetchbody

$structure= imap_fetchstructure($mbox, $newmsgnumber);
	if ($structure->encoding == 4){$bodyhtml = quoted_printable_decode(imap_fetchbody($mbox, $newmsgnumber,1.2));} 
	elseif ($structure->encoding == 3){$bodyhtml = base64_decode(imap_fetchbody($mbox, $newmsgnumber,1.2));}
	elseif ($structure->encoding == 0){$bodyhtml = quoted_printable_decode(imap_fetchbody($mbox, $newmsgnumber,1.2));}

Any suggestions?

Can you explain in detail what you expect the above code to do?

What do the variables $mbox and $newmsgnumber contain?

Sure I am sorry, the $mbox variable is:
$mbox = imap_open($hostname, $username, $password);
and $$newmsgnumber is the number of the last messages in the inbox. That all works correctly. Right now it pulls up the email and that text but if the email has an image it brings up a broken image icon. That is what I am looking to fix.

Is there anyone out there who can help?