Add imagelayer support in XML, fixes #16
fix some issue with imagelayer parsing