Only set the width or height, and it will scale the other automatically. And yes you can use a percentage.
The first part can be done, but requires JavaScript, so might not work for all users.
CSS is enough:
img {
width : desired_width;
height: auto; /*to preserve the aspect ratio of the image*/
}