Added check for non-reasonable dimension sizes