Section 5. The said county commissioners may contract, subject to the approval of the court of quarter sessions of the proper county, for that part or portion of the viaduct or bridge which crosses any river, creek, stream, or other place, over which the county is by law authorized to build bridges, including the abutments and piers thereof, and such part shall thereafter be maintained as a county bridge; or they may contract for such part or portion of the whole structure as is equal to the part or portion of the viaduct or bridge over the respective river, creek, stream, or other place, as aforesaid: Provided, however, That the said county commissioners may contract to pay an amount of money greater than that which is hereinabove provided for, toward the construction of said work, but the amount of the said additional moneys, over and above the amount necessary to build the viaduct across the respective river, stream, creek, or other place, shall be first approved by the court aforesaid.