Check for hasOwnProperty on tiles object

when using for in with libraries that modify Object.prototype this
causes erroneous keys to be attempted, note that there are other places
in the code with similar for in statements that may produce errors as
well