swipe gallery recoded to js