Fixed missing width and height calculation