Minor cleanup when calculating pixeldepth for image.