You do not have two variants. You have two characteristics.
Variants are the combination of all the possible values of each characteristic.
Si if you have 3 values (red blue green) for the first characteristic and 2 values (big small) for the second, that will give you 6 variants that you can edit via the button "manage variants" of your product.
And thus, in the 2 variants for red, you want your red image, in the 2 variants for blue, you want your blue image and in the 2 variants for green, you want your green image.
So in the hikashop_file table, with that example, you would need 6 entries, one for each variant.