updated icon scaling algorithm