Convert drawable to bitmap to avoid ClassCastException