update function scale image