Support more/less than 4 panels.

The next panel was selected incorrectly if the number of panel was not equal to 4. It will now work for panel count less than or greater than 4. (named the count variable as slidesCount as panelsCount was already being used and the image replacement uses it)