Hi Christopher - I don't know if it's a typo but this:
$write_buffer .= "\r\n" . $jpeg . "\r\n\r\n"; $r->print($write_buffer);
is not the same as this:
$r->print($write_buffer); $r->print($jpeg); $r->print("\r\n\r\n");
since the latter does not insert "\r\n" between $write_buffer and $jpeg... Larry