fixes a NaN parse error

if width or height are postfixed with "px" for example, like width="400px", then the parseInt results in a NaN. This fixes that issue.