Make validate_img a const member function.