Image preprocessing for Android