Store region information in separate array to support more than 254 regions, which fixes issues when decoding large images (e.g. screenshots)
Merge commit '74b72a89a42e1d5b10294c168d7427e8f38edae9'