I dont know the answer why it doesnt show user, but it shows same image, because there is no code that will actualy get random image.
u have$num_image = 6;
thats actualy picking image from that category. it should be atleast like this:
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
and then change LIMIT $num_images";
to thisLIMIT $number";