Improved handling of TimThumb thumbnails