DB2 SUM of MAX values, single table
I think you want multiple aggregations:

First find the max for each ID-Source combination, then sum for every ID:

select ID, sum(MaxNumImages) as SumMaxNumImages
from
  ( 
    select ID, max(NumImages) as MaxNumImages
    from table 
    where Source in ('A','B') and Event = '190'
      and NumImages is not null
    group by ID, Source
  ) 
  as agg
group by ID ;