Fixed possible crash in TileDelegate

This crash is not possible to trigger when using the UI to add tilesets,
but by editing the map or tileset file you can set up tilesets that
have a tile count that is not divisible by the column count. The
TileDelegate was not dealing correctly with table cells for which no tile
exists.