Created a getImageMaskForRange which takes in an image, lower array and upper array and outputs a mask