Extract Image object
Refactor image extraction and tests