final js and gallery set up