Both iMessage and Webkit have to accept requests from unknown sources that can contain a wide variety of content type. some other content types, like EPS are themselves programming languages that could contain infiltration scripts. That is why Apple has dropped EPS support. Similar situation can happen for other kinds of image and video content.
I don't know much about how iMessage communication is implemented but it does offer end to end encryption and supports richer interaction and content than plain SMS does. that was one of the reasons that Apple marked SMS clients with the green bubbles to indicate not to expect the same interaction with them. It was some little shits that turned that into an anti-status symbol.