If the payment into the treasury is inconsistent with the terms or conditions of any gift, devise, or bequest, the board of library trustees shall provide for the safety and preservation of the fund, and the application thereof to the use of the library, in accordance with the terms and conditions of the gift, devise, or bequest.