I found a fix (not my work) that makes it work for Samsung devices. The blog with explanation can be found here.
However, using this fix on non-Samsung phones returns the wrong image, so I would use an
if(imageURI != null) {
// do it the normal way
else {
// do it the "Samsung" way
}