replaced parseInt with math.round when width and height are set