The licensee shall have the licensee's license in immediate possession at all times when driving a motor vehicle and shall display it upon demand of any officer or agent of the department or any police officer of the state, county or municipality, except that where the licensee has previously deposited the license with the officer or court demanding bail, and has received a receipt from the officer or the court, the receipt is to serve as a substitute for the license until the specified date for court appearance of the licensee or the license is otherwise returned to the licensee by the officer or court accepting the license for deposit.