Fixed a bug which crashes the library. Happens when the tileSize is greater than the image size.