Instead of iterating over the entire table of media, it would be better to have a filtered list of only media with a poster.