As for where shops in the prison get their inventory...
Prison economy.
The prisoners are continuously trading and moving and stealing. Even the guards and officials might be part of the prison economy.
Not to mention as we can see the Island is full of ruins, sunken ships, and arcane secrets. So there is more then enough places they could be.
In fact it wasn't unusual for Wardens to trade favor to prisoners for their services in real life.
So yes... this whole "It doesn't make sense" makes perfect sense as long as you don't assume that this is a maximum security prison where people are frisked constantly.