Fixed bug for resource files that are attached to other posts or apges