Use width() and height() for sizing

The getAttribute('width') function seems to return a doubled value on HiDPI
devices, so switch to width() and height(). These functions previously didn't
work for SVG, though they do now. This may have been fixed in the new jQuery.