Image orientation bug - server-side solution