Port more image code.