Created Function for reading and sampling 2D/3D image data

closes-#3544
found == length for this case