Everything is now understood.
Create table image_diff (for example).
fields: image_id, second_image_id, percent
belongs_to :second_image, :class_name => "Image", :foreign_key => "second_image_id"
has_one :image_diff # communicate one-to-one, because first_image_id attached to the Image model
you can contact:
im = Image.first
im.image_diff.second_image # here it displays all the connections, so will need to sort out them one by one