the functions does not require a header, it will resort to searching for one if the format is not given.
I have used it many times with raw data with out a header.
From what you have written in the first post, I would try "BMP" or "PPM" if the function did not guess correctly with out a specified format.