imgur: some refactoring