I would use ASP.NET to tell the JavaScript what the file names are. Not sure about ASP, but this is how I'd do it in PHP:
<?php
$imageDir = 'images/';
$imagePaths = scandir($imageDir);
echo 'var imagePaths = Array ("' . implode('", "', $imagePaths) . '")';
?>