check for media entities before looping