Only adjust the height of the profile if the right elements are present

The home page of any site was causing a Javascript error because
this script assumed that the elements on object pages were present.