It turns out it was a bug on the tile cutter. The order in witch it cropped the tiles was incorrect and i didn't notice while giving a look at them "manually".
I encourage you to double check the tiles if something like this happens to you.
The code works fine as is.