Memory Efficient Large-Scale Image-Based Localization