Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.
I think when you receive the BLOB (the image) from INDI, one of the fields is "format". So you may have to wait until you actually receive an image before deciding what type it is.
Also, one of the standard INDI properties is CCD_CFA, which has information needed for debayering (if appropriate).
Keep in mind I don't write many INDI clients. I work mostly on the driver side of things. So I might be wrong.