fixed bug where json would try to access jpg before creation