This piece of code fix the size of the tile when change from one element to other.