correct the corrupted images problem