WICKET-5445 Make CaptchaImageResource easier to extend and reuse

Make CaptchaImageResource easier to extend and add demos with Kaptcha and Cage libraries

(cherry picked from commit 853b568a5e75305722e487b85082eb923f8b6d31)