update image re-sizer function