fix bug that wrong slice headers may be accessed from picture