updates for handling JSON responses from image endpoint