ImagePreloader.load(url, new ImageLoadHandler() {
@Override
public void imageLoaded(ImageLoadEvent event) {
if (!event.isLoadFailed()) {
Dimensions dimensions = event.getDimensions();
originalWidth = dimensions.getWidth();
originalHeight = dimensions.getHeight();
addImage();
}
onImageLoad(event.isLoadFailed());
}
});