Bug fixes

Fixed compatibility issue with older version of PHP and reduced DB
calls - function will now only check if image is within the Media
Library when it hasn't already been resized (used to check regardless).