Better logic for media rendering.