I figured it out myself.
the problem was that i was using
x: {with of next element}
That meant that i was always sliding the element width relative to the starting position.
Now I add the width of the next element to the width of all previous Elements.
var realSlideWidth = 0;
for (let i = 0; i < slideWidth.length; i++) {
realSlideWidth += slideWidth[i];
t1.to('.gallery-slider', {x: -realSlideWidth, duration: slideDuration});
}