Fixed miscalculation of width for objects by using same approach used fo...

...r height. Width was detected as 0.