Fix: change the counter value, when resizing the Gallery