Fixed retrieving of photo info and generation of html code