fixed an issue with image IO