abort transaction insert into images ( image_id, width, height ) values ( :revision_id, :width, :height ) select count(1) from cr_items where item_id = :item_id