Any person violating any of the provisions of this act shall be guilty of a misdemeanor, and, upon conviction thereof, shall be sentenced to pay a fine of not more than fifty dollars for the first offense, not more than one hundred dollars for the second offense, and not more than five hundred dollars for the third or any subsequent offense, and in addition thereto to undergo imprisonment for not more than thirty days for any third or subsequent offense.
31 P.S. § 512