cleaned up get_file and memory hog for image importing