Bug 895726 - Ensure valid filename inside Gallery view activity

Gallery will be in charge of maybe saving the file that we are passing.
If it receives a file that has no extension, trying to save inside the
'pictures' DeviceStorage will fail because of the missing extension. So
we check if the filename has one and if it does not, we force one by
guessing from mime type.