You could use an IM client such as Beejive to do that. If you're asking about the standard messaging app, though, that does not support such protocols.
If you're talking about sending a pic via yahoo messenger off the iPhone then yes a number of apps can do that including the official y! Messenger app.