Prevent array out of bound error when cropping. Corrected details on calling glob