GetImage function.