The disclosure includes a composition including a poly(L-glutamic acid) a nd a NIRF dye. It also includes a method including providing to a plurality of cells an imaging agent including poly(L-glutamic acid), a NIRF dye and th en imaging the cells to detect the imaging agent. It further includes a dual functional contrast agent including an MRI agent conjugated with an optical imaging agent. A method of detecting cancer is provided including injecting a dual functional contrast agent into a patient and performing both an MRI and an optical scan. The presence of the agent may indicate cancer. A method of detecting cancer by injecting PG-DTPA-Gd-NIR813 into a patient, then det ecting the presence or absence of Gd in a cell or tissue of the patient and detecting the presence or absence of NIR813 in a cell or tissue of the patie nt is provided. The presence of Gd and NIR813 may indicate cancer.