adds max image size
err handling