Previous commit wasn't the sollution cause it broke 1000*1000 this one seems to work for most formats