improve error handling in raw service (if image cannot be processed)
a lot of small fixes after Ilya's review
warnings clean up