if media is undefined, dont try to show an image