Section 24. This chapter shall not authorize the arrest or conviction of the owner or proprietor of a race track or trotting course for the reason that another person has without his knowledge or consent violated any of its provisions relative to the buying and selling of pools or the registering or making of bets or to any offence mentioned in the preceding section; nor the arrest or conviction of a person for being present on a race track or trotting course where pools are sold or bets registered or made on trials of speed or endurance between horses or other animals; but this exception shall not apply to a person in any way participating or assisting in the buying or selling of pools or registering of bets.