modify the gradient check
add  script function to detect on image based on the script image