Dealing with defective pixels