add tmp_image code