Fixed image to json conversion