Change http status code for invalid image with invalid size.

With unit test.