Correctly handle errors in /v1/images/{id}/layer.