To erect or purchase, establish and maintain hospitals, prisons, workhouses and houses of correction for juvenile or other offenders, and to prescribe regulations for the government thereof, and also to erect all public buildings necessary for the use of the city or of any department thereof.
53 P.S. § 23122