JSON reader: factor out a loadImage method
JSON reader: read properties and terrains after tile info

The tile info code will be used for adding tiles with individual
images.
Properties and terains should be loaded afterwards, when all tiles
are available.
JSON plugin: Support tilesets with external images
Merge pull request #582 from encukou/json-external-images

JSON plugin: Support tilesets with external images