It may be that the browser displays weird characters or do nothing at all displays when you send an image to the browser.
On the one hand there should be nothing other than send the image (either the html code, characters, etc ...) and secondly you must specify the type of image to display.
To specify the type of image that we display to the browser, it is enough to top a code that differs depending on the type of the image but may take the following values (and other less commonly used):
There are other possible values for the image type according to the type of image returned:
header ( 'Content-type: image/gif' );