Fixed support for height and width tags, and cleaned up code a bit.