 void loop() {
     static unsigned long futureTime;
 
-    int index = random(num_files);
+#if (START_WITH_RANDOM_GIF == 1)
+    static int index = random(num_files);
+#else
+     static int index = 0;
+#endif   
 
     if(futureTime < millis()) {
-        if (++index >= num_files) {
-            index = 0;
-        }
-
         if (openGifFilenameByIndex(GIF_DIRECTORY, index) >= 0) {
             // Can clear screen for new animation here, but this might cause flicker with short animations
             // matrix.fillScreen(COLOR_BLACK);


#define USE_SMARTMATRIX         1
#define ENABLE_SCROLLING        1

// range 0-255
const int defaultBrightness = 255;

            // Calculate time in the future to terminate animation
            futureTime = millis() + (DISPLAY_TIME_SECONDS * 1000);
        }

        // get the index for the next pass through
        if (++index >= num_files) {
            index = 0;
        }
    }

    decoder.decodeFrame();
