The easy way is to store the icons with some form of identifier.
Then, you can say to display scroll location + 0, then scroll location + 1, then +2, then +3, etc.
Example:
a=0, b=1, c=2, d=3, e=4
Scroll Location = 0
So, modification # in this case is 0.
0 + 0 = 1, so display "a"
then
0 + 1 = 2, so display "b"
When you scroll right 1 from there, then scroll location = 1, so:
1 + 0 = 2, display "a"
1 + 1 = 3, display "b"
If you scroll left 1 from the 0 position, scroll location would be -1, so:
-1 + 0 = -1, diplay the last icon in your list (we'll just say "z")
-1 + 1 = 0, display "a"
This idea can be easily added into any script you have to display the icons.