add ability to handle images of different sizes