use scandir to get the image file path in gengrid_gridtext.c