WIP: working on changes for biobank 3.9.0

refactored image region code