The sample code RandomPublicPhoto calls the API
flickr.photos.getRecent against the global pool of Flickr photos, so
it's by nature randomized. If you search on a given keyword, on the
other hand, I don't see why the fetch result would be "random" enough
unless you're searching for a really trendy keyword, but Flickr
usually ensures the order of such search, so don't count on that.
You'll need to plan for making separate calls. For example, first
fetch 10 photos, get the total number of pages, then fetch the
remaining pages separately. Then use the fetched, aggregated pool to
show photos randomly.
d.