Filetypes and few code-style optimizations

- Include image/jpg besides image/jpeg (some clients give this differently)
- fileTypes as a common variable for all resize/crop functions
- Fix some wrongly declared variables
- Use consistent code style