Saving and showing image with no leaks