It is possible. Most likely you would do the scripting with Javascript to control changing the images. The tricky part comes in from scanning the folder where you store the images. This would be done either with PHP or Perl, whichever you use on your server. Basically, the PHP code would give the javascript the names of all the images in the folder so the javascript can cycle through.
Here is the PHP code to read the names of all the files in a directory.
PHP Code:
<?PHP
// Define the full path to your folder from root
$path = "/www/folder/path/img/";
// Open the folder
$dir_handle = @opendir($path) or die("Cannot open the file $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
$filepath = 'your.url/path/'.$file;
echo $filepath;
}
// Close
closedir($dir_handle);
?>