fix wrong calculated width and height for draw image element