Update: How to update the first two rows with a Y flag
You don't need a cursor for this:

update IMAGES
  set OMG='Y'
where image_identifier in (select image_identifier 
                             from (select image_identifier 
                                     from IMAGES 
                                    order by IMAGE_IDENTIFIER) 
                            where rownum&lt;=2)


If you want 2 rows per TP_IDENTIFIER, I'd go for a window function:

update IMAGES
  set OMG='Y'
where exists   (select 1 
                  from (select image_identifier,tp_identifier,  
                               row_number() over (partition by tp_identifier order by image_identifier) as rn
                          from IMAGES 
                       ) t
                 where t.image_identifier=IMAGES.image_identifier
                   and t.tp_identifier = IMAGES.tp_identifier
                   and rn&lt;=2)