Add condition for when media resource isn't a media set and doesn't contain a media file

Squashed commit of the following:

commit 9c80dda557725d9d79af826d3f0a419c95487dd2
Author: Jonasz Grochowski <tensaioni@gmail.com>
Date:   Fri Sep 12 09:53:27 2014 +0200

    Add condition for when media resource isn't a media set and doesn't contain a media file