Change dict structure in glance_image resource and fix unittests