More work for repeatelement in joined group + removed confusing change made for another PR
Should obviously not affect anything else but query results. The query syntax was originally in each case generated as "parent_id = `table`.`pkfield`" and my fixes don't change this syntax - just the field name depends everywhere on whether the field is in main table or in joined group.
BTW - no idea whether the fileupload element uses only the code from element.php for its ajax upload. But if yes then this could be a solution for fileupload as well :) Feel free to test