Fixed a possible crash in the orthogonal map renderer

The function drawing tile layers was not always keeping the tiles it
would try to draw within bounds of the tile layer. This effected the
Terrain tool preview and possibly other tools as well.

Closes #756