save images with proper extension
cubes json in separate file