* check for null first! (avoid crash if no layer is specified)
* `graphic` instead of `graphics` for <sprite graphic="foo.png">