fix bugs in Image func