Bug Removal for checking picture no. when changing direction