Handle images of different size gracefully