use getopt(3) to get output image type
say error if output image type option is specified more than once
free type_str as soon as possible
add output image type option to usage message