In html table, insert image that's file name with some certain words

I want to insert a image file in to a html table, file name is ?FL GR ?.jpg (could be any words or no word) but I can not.

Code is below

<SCRIPT Language="JavaScript">
    var test = *'FL%20GR%20'*
    document.write('<td style="vertical-align: top; height: 362px; width: 538px;"><img style="width: 564px; height: 354px;" alt="123" src=' + './pic%20vid/123/' + test + '.jpg' + '><br></td>')

The purpose of this script is I can always show image that is with some certain words of file name without modifying html scripts, for example:
(1) This time I put 1FL GR 1.jpg in folder /pic vid/123/, the html table can show image of 1FL GR 1.jpg
(2) I delete 1FL GR 1.jpg, and then put 2FL GR 2.jpg in the same folder, refresh the html, the html table can show image of 2FL GR 2.jpg.