Argh. I did type out a nice long reply but the site died and lost my comments. I'm not rewriting it all so this will be very brief instead.
The wml spec probably wont let you do this client side so you have your wml image element call a server side script instead. E.g. instead of src="myfile.jpg" you have src="myscript.cfm?i=myfile.jpg"
This script rotates the image (e.g. in Cold Fusion use cfx_image) and returns the binary data with the appropriate image content-type.