Modified script to support confidence image name