modified phpthumb class for compatibility with php 5.4