Section 7. Whoever is convicted of a crime punishable by a fine, and is liable to imprisonment in the jail for its non-payment, may be sentenced to such imprisonment in the house of correction, or to confinement at hard labor either in the jail or house of correction.