fixed 'weighted' option to work in responsive builds, improved resizing function