Refactor get image