Added image rescaling