fixed bug in resize algorithm