use libbootimage functions and simplify the option handling.
implement image extraction in the new style