A thumbnail creation class in PHP