Enabled visualize command to work on devices

This is an improved version of #18 by @bencochran. (It looked like he’s not available to work on it further for now, so I decided to do it). Now both local and remote images are saved to disk using one method, by reading memory from process. What do you think?