handle corrupted images