Aspect 1: you have to know the format of the image file. Then you write that format. Likely any standard image files (PPM, BPM, TIFF,...) will include some sort of header. This is inherent in writing a standard image file, independent of the language.
Aspect 2: Fortran 2 used to be relentlessly record oriented, even for unformated (binary) files, which didn't "play" nicely with files written by other languages such as C, or file formats specified without the record deliminators expected by Fortran. But the new Stream I/O method produces non-record files. An image file will be unformatted (binary), so in the open statement include:
access='stream', form='unformatted', ....