support for lagre tiles
added some logic to store the original filename