refactor non used image function