Refactor code for getting static image from streetview