<p>Select a Course to filter your content:</p>
<?php

global $user;

foreach ($user->og_groups as $key => $val) {
  $items[] = l($val['title'], 'myfiles/images/' . $key);
}

print "<div class=\"view-filter-class\">\n";
print theme('item_list', $items);
print "\n</div>\n";
?>
<p><a href="?q=myfiles/images">View all of my images</a></p>