removed bug in getImgWidth, border was added twice