Fix for "Undefined index" Notice

In my site, I'm applying a custom taxonomy to media library items (I know, right?). When I do that, on the item's page, I was getting an "Undefined index" notice.

Using array_key_exists() instead of just testing for the value of the key solves this.