code: @Override
      public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
          Object entity = context.getEntity();
          if (entity instanceof Images.Captcha || entity instanceof Captcha) {
              context.setMediaType(IMG_TYPE);
              context.getHeaders().putSingle(HttpHeaders.CONTENT_TYPE, IMG_TYPE);
              if (entity instanceof Captcha) {
                  Captcha captcha = (Captcha) entity;
                  context.setType(BufferedImage.class);
                  context.setEntity(captcha.getImage());
              }
          }
          context.proceed();
      }
docs: {@inheritDoc}