A JS Based Gallery Function