Javascript set featured image bug fix