support for images of different sizes
performance gain, probably  meant to do this before