Synthesis, characterization, and thermal properties of anhydride terminated and allyl terminated oligoimides