diff --git a/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php b/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php
index <HASH>..<HASH> 100644
--- a/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php
+++ b/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php
@@ -89,7 +89,12 @@ class ImagesFormInput extends FormInput {
         $table = $this->getScaffoldSectionConfig()->getTable();
         $record = $this->getScaffoldSectionConfig()->getTable()->newRecord();
         if ($table instanceof KeyValueTableInterface) {
-            $record->fromData([$record::getPrimaryKeyColumnName() => 0, $this->getTableColumn()->getName() => $value], true);
+            $fakeData = [$record::getPrimaryKeyColumnName() => 0, $this->getTableColumn()->getName() => $value];
+            $fkName = $table->getMainForeignKeyColumnName();
+            if ($fkName) {
+                $fakeData[$fkName] = array_get($data, $fkName);
+            }
+            $record->fromData($fakeData, true);
         } else {
             $record->fromData($data, !empty($data[$record::getPrimaryKeyColumnName()]));
         }
ImagesFormInput::doDefaultValueConversionByType() - added foreign key value for key-value table's record so it can be used in ImagesColumn to create path to files based on foreign key value