Js framework auto adjusting gallery