separate new gallery js code to own module