A javascript gallery creator/controller