You should use the Random images plugin (search for it here). Upload random.php to your galleries and then refer to it via an include php tag in your wordpress file. Remember to order the images by ID instead of RAND() by editing random.php so it displays the latest images.