Added protection of photos removal

If tab change was not triggered, don't do anything with photos