ReadImg: add workaround for javac stupidity

Once the 'rawtype-img-opener' branch is merged, this problem will go
away and we can remove this workaround.