Fix FD for portrait images just after "history stack" -> "discard"