added conditional to exclude any links that don't include jpg or jpeg