Fixes #503 by only querying for MediaFiles that have a valid mediaId

(which means it is a MediaFile that is in the site’s Media Library and is not a local MediaFile)