I assume you're thinking of using Tobias' random solution ? His is based on selecting tiddler titles. Haven't tried it, but assuming you could construct a massive filter like:
\define reimage() C:\mypath\fw_$(num)$.jpg
<$list filter="0001 0002 0003 ...etc... 4000 +[random[1]]" variable="num" >
<$image source=<<reimage>>/>
</$list
which could be used to build fw_0001.jpg, fw_0002.jpg, fw_0003.jpg ...
Not sure what the performance would be like with 4000 items, or if the parser would break.
Or if you had a data dictionary with the file names in it, or even just numbers 0-4000 you could used the indexes operator.
Mark