check image existence before run it.