Layton, in the case of those who want randomly selected logos for say, 'pirates', would you the first instance of each letter (ie, pirates being in the 'p' section of the list) do this?
if first letter of word is 'p' then create array
for each following word that starts with 'p' add to array
if following word does not start with 'p' then
get length of array
range of random numbers starts from 0 to (length of array - 1)
random 'pirate' logo is equal to array 'pirate' [random number]
or something like that. It has been a LONG time since I took a programming course.