Fix compilation problem and add image library.