The mayor and council members shall have full power and authority to prescribe by ordinances adequate penalties for all offenses against the ordinances of said city, in ways hereinbefore provided for, and to punish offenses by fines and/or imprisonment not exceeding the limits prescribed by state law for each offense, or both, to enforce the payment of fines, to compel offenders and those who refuse to pay said fines to work on the streets or public works of said city. They shall have power to compel offenders sentenced to imprisonment in the city jail, as aforesaid, to labor on public works or on the streets to be regulated by ordinance.