There are two options. You can either do an ORDER BY RAND(), or you can do a select all and randomize the selected rows in PHP.
Option 1:
SELECT * from IMAGES ORDER BY RAND();
Option 2:
//select images (example uses mysql_ library; it's deprecated so DON'T USE IT!)
$query = "SELECT * FROM IMAGES";
$result = mysql_query($connection, $query)
$rows = mysql_fetch_all($result);
//randomize the array of images
shuffle($rows);
//output the images here
Option 1 can get very slow with large datasets. In my experience, Option 2 is faster, but it would be worth doing your own tests to see what works best for you. Usually the difference will be only fractions of a second. Check the answers here for more information: MySQL: Alternatives to ORDER BY RAND() or here: How can i optimize MySQL's ORDER BY RAND() function?
A third option is to generate random ids and select the albums that match those ids. This is only suitable if you don't have gaps in your ids. I have never tried this.