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

One-line fix, as title.