Make image extraction and conversion more modular

Still work in progress