Fixed getBoundingRectangle method. It now includes padding border etc