Context-sensitive, randomly loading images
With a lot of teeth gnashing and a little bit of help I managed to get context-sensitive, randomly loading images to work in Drupal. Context-senstive embedded views and the comments in Using views_build_view to control your own views were both very helpful (thanks to ynn for the suggestion to look up the views_build_view function).
I wanted the images to appear on book pages with the same category assignment so I altered node-book.tpl.php and added:
$tid = array_keys($node->taxonomy);
$current_view->args[0] = $tid[0];
$rimageview = views_get_view('Random_Program_Images');
print(views_build_view('block', $rimageview, $current_view->args, false, 1));
"false" refers to the fact that I don't need to use a pager for this block (because there's not a long list of things displaying) and the "1" means "show only one image."
In the admin area I updated the view for Random_Program_Images and added an argument for Taxonomy Term ID set to Display All Values (with all argument options blank). There was a little bit of extra formatting on top of that, but the essentials are contained in those four lines. Super simple...once you know how.
