So you want to detect different line configurations, like this?
Working with arrays in C3 is not an easy task and if you want to check for 20 different line configurations, this will be a huge PITA..
I would probably do this with sprites and overlapping checks.
Create a new sprite with all line configurations, each in a separate frame - blue line on my screenshot. Lets call it Detector. Define correct collision polygons, following the line. Then simply place Detector on top of your set of pictures and pick all pictures overlapping it. You can then analyse picked pictures from left to right and check if they form a winning combination.
Then change Detector frame to the next one, and repeat the whole process for all frames.
Make sure collision polygons for pictures are not very big, otherwise diagonal lines may overlap wrong pictures.