You want to display an image on a web page which is selected randomly from a collection of images in a directory.
Use the <cfdirectory> tag to retrieve a list of all the images in a specified directory, then use the RandRange function to select one randomly.
<cfset imagepath = "images/gallery/">
<cfdirectory directory="#ExpandPath(imagepath)#"
filter="*.jpg|*.gif"
name="qryImages"
action="list">
<cfoutput>
<img src="#imagepath##qryImages.name[RandRange(1,
qryImages.RecordCount)]#" />
</cfoutput>
+