Add getIndex method to rawImage. I hope this works better this time.

I think I figured out what I'm supposed to be doing here.