update img and mask size