User library declaration is not removed from output code when the object is not created.
In the example below, only "image" declaration will be removed from output code, leaving "image2" as an invalid reference in code, since the user library import will be removed:
public class Teste {
private HDRImage image;
private HDRImage image2;
public void method() {
image = new HDRImage(...);
...
}
}