fixing image loop for json and adding comments