changed images usage and fixed XML read&write operations