image resize bug fix