Correcting refs to images