Section 24. A city may make ordinances to secure the inspection of ice sold therein and to prevent the sale of impure ice, and affix penalties of not more than twenty dollars for each violation thereof.