Gallery view JS resizing