Any person violating this chapter or the rules duly prescribed by the board of pharmacy shall be fined not more than $500, or imprisoned not more than six months, or both.