modified upload gallery flow