moved homepage logic all into the callback for images loaded