refactor receiveImage