Refactor generate-json.sh + make it generate image size entries.