Support for specifying widths as percentage of the original image's width.

I'm sorry if this is not the cleanest way of doing this, I'm not a Javascript programmer :|