Align to right edge instead of left edge

This has been addressed in a couple of comments and would be very useful; also, an option to vertically align the image to the bottom or top edge would be cool. This code tested in IE7-9, Firefox, Safari and Chrome on Windows, and Firefox, Safari, Chrome and Opera (12.02) on OS 10.8.2.