fetch and display stdout and stderr
more readable code, better success message
fix success message for displaying number of images