This part should be outside setup().
char *names[12] = {
"1.bmp",
"2.bmp",
"3.bmp",
"4.bmp",
"5.bmp",
"6.bmp",
"7.bmp",
"8.bmp",
"9.bmp",
"10.bmp",
"11.bmp",
"12.bmp",
};
int which_number;
As you have it now, they are local to setup() and hence not known in loop(). Moving them outside setup() (and any other function) makes the global and know in all functions in the sketch. You can read up on scope; e.g. Scope of Variables in C++ - GeeksforGeeks.