add a lot of const qualifiers in image IO