added exception sefety to some image operations
new way of processing images (got bizzare exception problem handling though)