Replace accidentally deleted code

Some stuff accidentally got removed
from image ingestion code. Put it back.