public BoundedImage(String url, int maxWidth, int maxHeight) {
super(url);
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
ImagePreloader.load(url, new ImageLoadHandler() {
@Override
public void imageLoaded(ImageLoadEvent event) {
if (!event.isLoadFailed()) {
Dimensions dimensions = event.getDimensions();
width = dimensions.getWidth();