if (su instanceof MainFrame) { prefsIndex = ((MainFrame) su).galleries.getSize();
if (GalleryRemote.getInstance().mainFrame != null) { prefsIndex = GalleryRemote.getInstance().mainFrame.galleries.getSize();
	public Gallery(StatusUpdate su) {		this.su = su;		if (su instanceof MainFrame) {			prefsIndex = ((MainFrame) su).galleries.getSize();		}	}