Buggy code:
public final class LocalizedImageResource implements Serializable , IResourceListener { private static final long serialVersionUID = 1L ; private Boolean resourceKind ; private Component component ; private Resource resource ; private ResourceReference resourceReference ; private ValueMap resourceParameters ; private transient Locale locale ; private transient String style ; private static final class ImageValueParser extends MetaPatternParser { private static final Group factoryName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group imageReferenceName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group specification = new Group ( MetaPattern . ANYTHING_NON_EMPTY ) ; private static final MetaPattern pattern = new MetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . factoryName , MetaPattern . COLON , new wicket . util . parse . metapattern . OptionalMetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . imageReferenceName } ) , MetaPattern . COLON , LocalizedImageResource . ImageValueParser . specification } ) ; private ImageValueParser ( final CharSequence input ) { } private String getFactoryName ( ) { } private String getImageReferenceName ( ) { } private String getSpecification ( ) { } } public LocalizedImageResource ( final Component component ) { } public final void bind ( ) { } public final void onResourceRequested ( ) { } public final void setResource ( final Resource resource ) { } public final void setResourceReference ( final ResourceReference resourceReference ) { } public final void setResourceReference ( final ResourceReference resourceReference , final ValueMap resourceParameters ) { } public final void setSrcAttribute ( final ComponentTag tag ) { if ( ( ( resourceKind ) == null ) && ( ( ! ( Objects . equal ( locale , component . getLocale ( ) ) ) ) || ( ! ( Objects . equal ( style , component . getStyle ( ) ) ) ) ) ) { this . locale = component . getLocale ( ) ; this . style = component . getStyle ( ) ; this . resourceReference = null ; this . resource = null ; } else { } if ( ( ( resource ) == null ) && ( ( resourceReference ) == null ) ) { final CharSequence src = tag . getString ( "src" ) ; if ( src != null ) { loadStaticImage ( src . toString ( ) ) ; } else { final CharSequence value = tag . getString ( "value" ) ; if ( value != null ) { newImage ( value ) ; } else { loadStaticImage ( component . getModelObjectAsString ( ) ) ; } } } final CharSequence url ; if ( ( this . resourceReference ) != null ) { url = RequestCycle . get ( ) . urlFor ( resourceReference , resourceParameters ) ; } else { url = component . urlFor ( INTERFACE ) ; } <START_BUG> tag . put ( "src" , Strings . replaceAll ( component . getResponse ( ) . encodeURL ( url ) , "&" , "&amp;" ) ) ; <END_BUG> } private IResourceFactory getResourceFactory ( final Application application , final String factoryName ) { } private void loadStaticImage ( final String path ) { } private void newImage ( final CharSequence value ) { } }

Fix:
tag . put ( "src" , Strings . replaceAll ( RequestCycle . get ( ) . getOriginalResponse ( ) . encodeURL ( url ) , "&" , "&amp;" ) ) ;