The mayor and council of the city shall have the power and authority to prevent horses, mules, cattle, h ogs, sheep, goats, d ogs, chickens and all other animals and fowl from running at large in said city; to regulate, prevent or prohibit the keeping of certain animals within the city limits, or to regulate the number and manner in which they must be kept, if allowed; and shall have full power and authority to take up and impound any of such animals and punish all owners of any of such animals who shall fail or refuse to obey such ordinances as may be adopted by the mayor and council of said city to carry out and accomplish the purposes of this Section.