Thanks for the suggestion V@no but you were right, it doesn't work properly.
I also tried replacing the line below
function get_random_image_cache() {
with
global $site_db, $cat_cache, $total_images, $image_row, $lang;
That didn't work either.
namaste,
Jennifer