add optional config to Image

fix some bug