If payment into the treasury is inconsistent with the conditions or terms of any gift, devise, or bequest, the board 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.