smart resizer script