Fix invalid cast from Video to Photo, and other terminal warnings
This fixes a terminal warning about casting a Video to a Photo when Photos is opened and there are Videos in the library.
Most of the checks before casting are probably not actually necessary but were fixed anyway. Also fixes a number of other terminal critical warnings - some these fixes are proposed as separate PRs and it suggested that these are merged first in order to reduce the diff and scope of this PR.
Also the second commit fixes a problem where the context menu on Videos had a "Open in" option but the submenu was empty.
Video handling in Photos (e.g. thumbnailing) is not very good. It needs to be decided whether it is worth continuing video support before spending the time to improve it.
Leaving as draft until other component fixes are merged. See #689, #690, #691