The variable img_no is the index of the current background image.
The next image to appear is the next one in order the array, or the first one if we're at the end, which is the (img_no + 1) %nbr_of_image image in the array.
I suggest you define a nextImageIndex variable which will track what the index in the arrayt of the next image to fade in is. When that image becomes the background one, set no_img to that index, and randomly pick a new nextImageIndex between 0 and nbr_of_images.
We'll teach you how, but we won't just do it for you. Try it yourself.