The query says, "Get five random items that are not in moderation." There isn't an error in the query, and assuming there are no files in moderation, the only other thing I can think of is that maybe you have a cache type add-on. The change you made looks find, and there is nothing in the code that needs to be fixed. Something else seems to be interfering with the results. One thing you can try is to run the following query in phpMyAdmin and see whether you get five results:
Code:
Content visible to registered users only.