Imagedata indexing corrected, logic rectified
Indexing rectified, source commit