Mixing text commands and binary image data on one stream
Problem
Sending both plain-text commands and raw PNG bytes over the same socket risks one corrupting the parsing of the other.
Solution
Text commands are newline-terminated; image responses are framed with an explicit byte count read before the payload, so the receiver always knows exactly how many bytes to read regardless of content.
