#9001843254BM6....
The #9 means the next 9 characters (001843254) will tell the length of the following binary data block. BM6 are the first bytes from the screenshot (in text representation), BM6 means the picture format is .bmp, which is an uncompressed image format, so it will always have the same length for a given picture size.
If that always stays BM6 no matter the oscilloscope format settings, it means it always sends a .bmp, while the application expects a .png (judging by the SCPI command containing a png request). Sounds like a bug.
The receiver GUI would be able to detect the encoding by looking at the first data bytes, though I don't know if format detection is the pillow lib's job (or whatever other library the GUI may use), or if the format detection must be dealt with in the GUI code before converting it with a lib. Maybe the SCPI command for MSO5000 must be changed, too, so the GUI will not assume a PNG, and look at the first bytes of the data to properly identify the format.
Seems clear what is happening, but I'm not familiar with that part of the code so I can not tell the proper fix.