 }
 
 // Displays the file name
-void displayFileName(char *fileName, boolean fileFound) {
+void displayFileName(char *fileName, boolean fileFound, int bmpWidth, int bmpHeight) {
   static long lastRandomNumber;
   long randomColor;
   unsigned int textColor[] = {

        Serial.print('H');
        Serial.println(" Pixels");

        // BMP rows are padded (if needed) to 4-byte boundary
        rowSize = (bmpWidth * 3 + 3) & ~3;


  boolean  flip    = true;        // BMP is stored bottom-to-top
  int      w, h, row, col;
  uint8_t  r, g, b;
  uint32_t pos = 0;

  if ((x >= tft.width()) || (y >= tft.height())) return;

