

Basically, the code downloaded the image from the server to get the width of it, then downloaded it again when it was viewed on the page - so essentially doubling the page-load time.
I've taken the code out and reverted back to the old size limits until I can figure out a new way of resizing the images.