Prevent infinite loop when file embeds itself

#6571 

@mpetrovic Is there any reason to allow the media embeds for files? Is it useful in a list of files?