Address sonarcloud findings
Address sonarcloud findings

- Use try-with-resource on FileInputSteam to ensure it gets closed.
- Check the return value from the read operation.

The second one is not likely to happen, and would likely hit one of the
catch blocks anyway but still seems like a good safety net anyway.

Signed-off-by: kingthorin <83ea41af2b636790c02743e48206546e1fa891e4@users.noreply.github.com>
veggiespam/ImageLocationScanner,veggiespam/ImageLocationScanner