As I pointed out several times in the last years, the .RefreshGallery method doesn't work with a full path nor a relative path. You must use an absolute path.
@Taifun might want to explain the reason for this (after all these years and countless questions).