Change scope of image function

The original repository have this function public for you can get the
image without create a file.

Sorry for my mistake.