refactor(historyImage): change creating method

move method to viewmodel