image_extract rewritten