Photos, videos, audio, voice notes, and documents are never sent inline over the WebSocket. You upload the file over HTTP first, get back an id, then send that id in a message. Going the other way, an incoming message gives you an id you download over HTTP.
That means every media flow is three steps: upload β send the id β the recipient downloads it.