Implement image resize and image auto image scaling.