Fix key type of Image.metadata to str in Py3