thumbnail mode: if --action is set, run it instead of opening images