change ImageCode function.