You would never get a 20mm in the back of a B17. It way too tight for space and if you did it could do little but fire straight back. A B24 has a lot more space in the rear and would probably fit but not a B17
The 20mm Hispano was a wacking big gun and is going to need big turrets to hold and feed it. It was done but the 20mm Hispano guns are NOT plug ins for the .50 cal Browning.
Some other peoples 20mm guns were much smaller and the very late war/post war Russian 20mm gun was about 1/3 the weight of the Hispano.
Early Hispanos also required a barrel support/mounting part way out the barrel. Or a gun cradle to support the point in question. The French managed a single 20mm turret but used a 60 round drum, the changing of which must have been a real joy for the gunner.
The early Beaufighters had 60 round drums which the navigator had to change. They were at floor level but still it was virtually impossible to do if the a/c was doing any manouvers. That poor turret gunner would have to be a combination of a weight lifter, gymnast and contortionist.
Part of the advantage of 20mm cannon is that the extra range means you can fire over a longer period of time so a 2 second .50" burst becomes a 3 second 20mm one.
I always thought loading the defensive guns with only tracer would have had a far more disconcerting effect on an attacking enemy, the prospect of having to dive on a box of B17's who are doing a damn good impression of the death star would have caused even the stoutest soul to flinch!
There were experiments made with special tracer that was much more visible from the front than normal tracer. The M21 tracer round was 3 times brighter than normal tracer.
You would never get a 20mm in the back of a B17. It way too tight for space and if you did it could do little but fire straight back. A B24 has a lot more space in the rear and would probably fit but not a B17
Hispano mk II
Length without muzzle brake: 2.32 m (7 ft 7 in)
Length with muzzle brake: 2.52 m (8 ft 3 in)
Weight without drum magazine: 43 kg (94 lb 13 oz)
Note the length of the 20mm then look at the photo of the rear of the B17 and work out how you are going to change a 60 rd drum.
Hispano mk II
Length without muzzle brake: 2.32 m (7 ft 7 in)
Length with muzzle brake: 2.52 m (8 ft 3 in)
Weight without drum magazine: 43 kg (94 lb 13 oz)
Note the length of the 20mm then look at the photo of the rear of the B17 and work out how you are going to change a 60 rd drum.
I don't know about the 20mm barrel which does seem to have some sort of shroud/fairing on it but the .50 cal next to it has a flashider on it.
The Flash hider has an ID about the size of the OD of the barrel jacket.
There seems to be way too much taper on the 20mm barrel for it to be the barrel alone, but from the angle of the picture it is hard to see if it is the actual muzzle.
Can't post the pictures here but googling B-17 rear guns will bring up pictures of the .50s both with and without flash hiders/tubes.