The council shall have the power to declare that the violation of any ordinance shall be a penal offense and to prescribe penalties therefor. No such penalty shall exceed a fine of $1,000 or imprisonment in a city or county jail for a period of 90 days, or both, but in either case the costs of prosecution may be added.