Earlier quoted context omitted.
Gate One (web-based terminal) has had this functionality for years: https://github.com/liftoff/GateOne/ Just 'cat someimage.jpeg' or 'cat someimage.png' and it'll display it right there in the terminal. Works great if I do say so myself (I wrote it =).
I couldn't get this to work reliably. The tty messed with cr and lf characters unpredictably. I'm curious if you found a way around this issue.
PNGs should always work as that format is very easy to detect.