I'm so sorry to bother you yet again with this issue, but I have additional problem:
Everything worked fine while there was only one gallery in the database, but when the second gallery was added, the images from attached page would upload into the first gallery even though I've created the Recordset and used the folder_name column from pg1_gallery table. Please see the attached file.
Thank you so much in advance for all your help!
P.S. Please see the PM in case you'll need a FTP access.