Refactored thumbnail lookup, default social media excerpt, php code