Change resize to extent with center gravity