Refactoring image handling
Some route fixes