image.php: Flush headers and output buffer to prevent a leading empty line in some instances.

Signed-off-by: Martin Stone <martin@d7415.co.uk>