Added in a length check to determine the correct partition for single partition image