Ideally you should never rely on this for your final optimized website, but you can use CSS 2's max-height and max-width to scale down an image and maintain the images aspect ratio. I have used this as a fail safe for php projects in the past when displaying user content. For example:
<style type="text/css">.scaledimg {max-height: 200px;max-width: 200px;}</style><img class="scaledimg" src="imagesourcehere" />