resize image.
added average