Move tempfile require to lib

Since tempfile should be required when using IMGKit it should be required by the lib and not only by the specs.