fix build errors on centos 5 with gcc 4.2

Hi, this request is a patch to fix a compile error with gcc 4.2 on centos 5.
```
resize.cpp: 'free' was not declared in this scope
thumbnail.cpp: 'free' was not declared in this scope
```